* [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review
@ 2015-05-26 15:40 Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 01/92] ext4: allocate entire range in zero range Kamal Mostafa
` (91 more replies)
0 siblings, 92 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa
This is the start of the review cycle for the Linux 3.19.8-ckt1 stable kernel.
This version contains 92 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/ubuntu/linux.git/log/?h=linux-3.19.y-review
git://kernel.ubuntu.com/ubuntu/linux.git linux-3.19.y-review
The review period for version 3.19.8-ckt1 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.19.y-ckt extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .
-Kamal
--
.../devicetree/bindings/dma/fsl-mxs-dma.txt | 2 +-
Documentation/kernel-parameters.txt | 2 +
arch/arm/boot/dts/am57xx-beagle-x15.dts | 2 +-
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts | 4 +
arch/arm/boot/dts/imx23-olinuxino.dts | 4 +-
arch/arm/boot/dts/imx25.dtsi | 1 +
arch/arm/boot/dts/imx28.dtsi | 2 +-
arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi | 2 +
arch/arm/boot/dts/omap3-n900.dts | 4 +
arch/arm/boot/dts/ste-dbx5x0.dtsi | 17 ----
arch/arm/boot/dts/ste-href.dtsi | 15 +++
arch/arm/boot/dts/ste-snowball.dts | 13 +++
arch/arm/mach-omap2/prm-regbits-34xx.h | 1 +
arch/arm/mach-omap2/prm-regbits-44xx.h | 1 +
arch/arm/mach-omap2/vc.c | 12 ++-
arch/arm/mach-omap2/vc.h | 2 +
arch/arm/mach-omap2/vc3xxx_data.c | 1 +
arch/arm/mach-omap2/vc44xx_data.c | 1 +
arch/arm64/mm/dma-mapping.c | 10 +-
arch/powerpc/kernel/idle_power7.S | 2 +
arch/powerpc/platforms/pseries/dlpar.c | 10 +-
arch/x86/boot/compressed/eboot.c | 2 +
arch/x86/include/asm/spinlock.h | 2 +-
arch/x86/kernel/cpu/microcode/intel_early.c | 2 +-
block/blk-mq.c | 50 +++++-----
drivers/acpi/acpi_pnp.c | 2 +
drivers/acpi/sbs.c | 2 +-
drivers/acpi/sbshc.c | 22 +++++
drivers/block/rbd.c | 5 +
drivers/firmware/efi/runtime-map.c | 6 +-
drivers/gpio/gpiolib-sysfs.c | 19 ++++
.../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 +-
drivers/gpu/drm/drm_irq.c | 9 +-
drivers/gpu/drm/i915/intel_dp.c | 6 +-
drivers/gpu/drm/i915/intel_lvds.c | 26 ++++-
drivers/gpu/drm/radeon/atombios_crtc.c | 3 +
drivers/gpu/drm/radeon/radeon_asic.c | 2 +-
drivers/gpu/drm/radeon/radeon_asic.h | 4 +
drivers/gpu/drm/radeon/radeon_cs.c | 4 +-
drivers/gpu/drm/radeon/radeon_ttm.c | 8 +-
drivers/gpu/drm/radeon/radeon_uvd.c | 105 +++++++++++++++------
drivers/gpu/drm/radeon/radeon_vce.c | 65 +++++++++----
drivers/gpu/drm/radeon/radeon_vm.c | 36 ++++---
drivers/gpu/drm/radeon/rv770d.h | 3 +
drivers/gpu/drm/radeon/si_dpm.c | 1 +
drivers/gpu/drm/radeon/uvd_v1_0.c | 14 +--
drivers/gpu/drm/radeon/uvd_v2_2.c | 29 ++++++
drivers/infiniband/core/cma.c | 27 ++++--
drivers/md/dm-crypt.c | 12 +--
drivers/md/raid0.c | 4 +-
drivers/media/platform/marvell-ccic/mcam-core.c | 14 +--
drivers/media/platform/marvell-ccic/mcam-core.h | 8 +-
drivers/mmc/card/block.c | 12 +++
drivers/mmc/card/queue.c | 2 +-
drivers/mmc/card/queue.h | 2 +
drivers/mmc/core/core.c | 1 +
drivers/mmc/host/sh_mmcif.c | 2 +-
drivers/pinctrl/core.c | 10 +-
drivers/pinctrl/core.h | 2 +-
drivers/pinctrl/devicetree.c | 2 +-
drivers/scsi/3w-9xxx.c | 57 +++--------
drivers/scsi/3w-9xxx.h | 5 -
drivers/scsi/3w-sas.c | 50 ++--------
drivers/scsi/3w-sas.h | 4 -
drivers/scsi/3w-xxxx.c | 42 ++-------
drivers/scsi/3w-xxxx.h | 5 -
drivers/scsi/scsi_devinfo.c | 1 +
drivers/scsi/scsi_scan.c | 6 ++
drivers/tty/hvc/hvc_xen.c | 18 +++-
drivers/tty/serial/atmel_serial.c | 2 +
drivers/tty/serial/of_serial.c | 1 -
drivers/tty/serial/uartlite.c | 11 ++-
drivers/tty/serial/xilinx_uartps.c | 12 +--
drivers/usb/chipidea/otg_fsm.c | 4 -
drivers/usb/class/cdc-acm.c | 7 +-
drivers/usb/storage/uas-detect.h | 11 ++-
drivers/usb/storage/uas.c | 16 +++-
drivers/usb/storage/usb.c | 8 +-
drivers/vhost/scsi.c | 6 +-
drivers/xen/events/events_2l.c | 10 ++
drivers/xen/events/events_base.c | 7 +-
drivers/xen/xen-pciback/conf_space.c | 6 +-
drivers/xen/xen-pciback/conf_space.h | 2 +-
drivers/xen/xen-pciback/conf_space_header.c | 2 +-
drivers/xen/xenbus/xenbus_probe.c | 29 ++++++
fs/btrfs/ioctl.c | 3 +-
fs/efivarfs/super.c | 2 +-
fs/ext4/extents.c | 46 +++++----
fs/ext4/extents_status.c | 8 ++
fs/ext4/inode.c | 2 +
fs/namei.c | 3 +-
fs/namespace.c | 6 ++
fs/nilfs2/btree.c | 2 +-
fs/ocfs2/dlm/dlmmaster.c | 13 +++
include/linux/nilfs2_fs.h | 2 +-
include/linux/usb_usual.h | 2 +
include/scsi/scsi_devinfo.h | 1 +
include/sound/emu10k1.h | 14 ++-
include/sound/soc-dapm.h | 2 +-
mm/memory-failure.c | 16 ++--
mm/page-writeback.c | 6 +-
sound/pci/emu10k1/emu10k1.c | 6 +-
sound/pci/emu10k1/emu10k1_callback.c | 4 +-
sound/pci/emu10k1/emu10k1_main.c | 21 +++--
sound/pci/emu10k1/emupcm.c | 2 +-
sound/pci/emu10k1/memory.c | 11 ++-
sound/pci/hda/hda_codec.c | 21 +++--
sound/pci/hda/thinkpad_helper.c | 1 +
sound/soc/codecs/rt5677.c | 5 +-
sound/soc/codecs/tfa9879.c | 4 +-
sound/soc/samsung/s3c24xx-i2s.c | 4 +-
sound/synth/emux/emux_oss.c | 11 +--
sound/synth/emux/emux_seq.c | 29 ++++--
113 files changed, 749 insertions(+), 458 deletions(-)
Al Viro (1):
path_openat(): fix double fput()
Alex Deucher (2):
drm/radeon: adjust pll when audio is not enabled
drm/radeon: add SI DPM quirk for Sapphire R9 270 Dual-X 2G GDDR5
Bard Liao (2):
ASoC: rt5677: add register patch for PLL
ASoC: rt5677: fixed wrong DMIC ref clock
Ben Hutchings (1):
xen-pciback: Add name prefix to global 'permissive' variable
Boris Ostrovsky (4):
xen/events: Clear cpu_evtchn_mask before resuming
xen/xenbus: Update xenbus event channel on resume
xen/console: Update console event channel on resume
xen/events: Set irq_info->evtchn before binding the channel to CPU in __startup_pirq()
Charles Keepax (1):
ASoC: dapm: Enable autodisable on SOC_DAPM_SINGLE_TLV_AUTODISABLE
Chris Bainbridge (2):
ACPI / SBS: Enable battery manager when present
ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook
Christian König (7):
drm/radeon: fix lockup when BOs aren't part of the VM on release
drm/radeon: reset BOs address after clearing it.
drm/radeon: check new address before removing old one
drm/radeon: disable semaphores for UVD V1 (v2)
drm/radeon: make VCE handle check more strict
drm/radeon: make UVD handle checking more strict
drm/radeon: more strictly validate the UVD codec
Christoph Hellwig (3):
3w-sas: fix command completion race
3w-xxxx: fix command completion race
3w-9xxx: fix command completion race
Chuanxiao Dong (1):
mmc: card: Don't access RPMB partitions for normal read/write
Dan Carpenter (2):
efi: Fix error handling in add_sysfs_runtime_map_entry()
vhost/scsi: potential memory corruption
Davide Italiano (1):
ext4: move check under lock scope to close a race.
Dean Nelson (1):
arm64: add missing PAGE_ALIGN() to __dma_free()
Doug Anderson (1):
pinctrl: Don't just pretend to protect pinctrl_maps, do it for real
Eric W. Biederman (1):
mnt: Fix fs_fully_visible to verify the root directory is visible
Eric Work (1):
md/raid0: fix restore to sector variable in raid0_make_request
Fabio Estevam (1):
ARM: dts: imx23-olinuxino: Fix polarity of LED GPIO
Gregory CLEMENT (1):
ARM: mvebu: armada-xp-openblocks-ax3-4: Disable internal RTC
Grygorii Strashko (2):
mmc: core: add missing pm event in mmc_pm_notify to fix hib restore
ARM: dts: am57xx-beagle-x15: Fix IRQ type for mcp7941x
Hans Verkuil (1):
[media] marvell-ccic: fix Y'CbCr ordering
Hans de Goede (3):
uas: Allow uas_use_uas_driver to return usb-storage flags
uas: Add US_FL_MAX_SECTORS_240 flag
uas: Set max_sectors_240 quirk for ASM1053 devices
Ilya Dryomov (1):
rbd: end I/O the entire obj_request on error
Jani Nikula (1):
drm/i915/dp: there is no audio on port A
Jason Gunthorpe (1):
RDMA/CMA: Canonize IPv4 on IPV6 sockets properly
Johan Hovold (1):
gpio: sysfs: fix memory leaks and device hotplug
Junxiao Bi (1):
ocfs2: dlm: fix race between purge and get lock resource
Li Jun (1):
usb: chipidea: otg: remove mutex unlock and lock while stop and start role
Ludovic Desroches (1):
tty/serial: at91: maxburst was missing for dma transfers
Lukas Czerner (2):
ext4: allocate entire range in zero range
ext4: fix data corruption caused by unwritten and delayed extents
Lukas Wunner (2):
drm/i915: Assume dual channel LVDS if pixel clock necessitates it
drm/i915: Add missing MacBook Pro models with dual channel LVDS
Marek Szyprowski (1):
arm64: dma-mapping: always clear allocated buffers
Marek Vasut (1):
ARM: dts: imx28: Fix AUART4 TX-DMA interrupt name
Mario Kleiner (1):
drm: Zero out invalid vblank timestamp in drm_update_vblank_count.
Markus Pargmann (1):
ARM: dts: imx25: Add #pwm-cells to pwm4
Michal Simek (2):
serial: xilinx: Use platform_get_irq to get irq description structure
serial: of-serial: Remove device_type = "serial" registration
Michel Dänzer (1):
drm/radeon: Use drm_calloc_ab for CS relocs
Mike Christie (1):
SCSI: add 1024 max sectors black list flag
Ming Lei (2):
blk-mq: fix race between timeout and CPU hotplug
blk-mq: fix CPU hotplug handling
Naoya Horiguchi (2):
mm/memory-failure: call shake_page() when error hits thp tail page
mm: soft-offline: fix num_poisoned_pages counting on concurrent events
Nathan Fontenot (1):
powerpc/pseries: Correct cpu affinity for dlpar added cpus
Oded Gabbay (1):
drm/amdkfd: allow unregister process with queues
Omar Sandoval (1):
btrfs: unlock i_mutex after attempting to delete subvolume during send
Pavel Machek (1):
ARM: dts: OMAP3-N900: Add microphone bias voltages
Peter Zubaj (1):
ALSA: emu10k1: Emu10k2 32 bit DMA mode
Philipp Zabel (1):
ARM: dts: imx6: phyFLEX: USB VBUS control is active-high
Quentin Casasnovas (2):
x86/microcode/intel: Guard against stack overflow in the loader
cdc-acm: prevent infinite loop when parsing CDC headers.
Rabin Vincent (1):
Revert "dm crypt: fix deadlock when async crypto algorithm returns -EBUSY"
Ross Lagerwall (1):
efivarfs: Ensure VariableName is NUL-terminated
Roy Franz (1):
x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr
Ryusuke Konishi (1):
nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()
Sam Bobroff (1):
powerpc/powernv: Restore non-volatile CRs after nap
Stefan Wahren (1):
ARM: dts: imx23-olinuxino: Fix dr_mode of usb0
Tahsin Erdogan (1):
x86/spinlocks: Fix regression in spinlock contention detection
Takashi Iwai (5):
ALSA: hda - Fix mute-LED fixed mode
ALSA: hda - Add mute-LED mode control to Thinkpad
ALSA: emu10k1: Fix card shortname string buffer overflow
ALSA: emux: Fix mutex deadlock at unloading
ALSA: emux: Fix mutex deadlock in OSS emulation
Takeshi Kihara (1):
mmc: sh_mmcif: Fix timeout value for command request
Tejun Heo (1):
writeback: use |1 instead of +1 to protect against div by zero
Tony Lindgren (1):
ARM: OMAP2+: Fix omap off idle power consumption creeping up
Ulf Hansson (3):
ARM: ux500: Move GPIO regulator for SD-card into board DTSs
ARM: ux500: Enable GPIO regulator for SD-card for HREF boards
ARM: ux500: Enable GPIO regulator for SD-card for snowball
Wei Yongjun (2):
ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe()
ASoC: samsung: s3c24xx-i2s: Fix return value check in s3c24xx_iis_dev_probe()
Witold Szczeponik (1):
ACPI / PNP: add two IDs to list for PNPACPI device enumeration
monk.liu (1):
drm/radeon: fix userptr BO unpin bug v3
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 01/92] ext4: allocate entire range in zero range
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 02/92] x86/microcode/intel: Guard against stack overflow in the loader Kamal Mostafa
` (90 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lukas Czerner, Theodore Ts'o, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Czerner <lczerner@redhat.com>
commit 0f2af21aae11972fa924374ddcf52e88347cf5a8 upstream.
Currently there is a bug in zero range code which causes zero range
calls to only allocate block aligned portion of the range, while
ignoring the rest in some cases.
In some cases, namely if the end of the range is past i_size, we do
attempt to preallocate the last nonaligned block. However this might
cause kernel to BUG() in some carefully designed zero range requests
on setups where page size > block size.
Fix this problem by first preallocating the entire range, including
the nonaligned edges and converting the written extents to unwritten
in the next step. This approach will also give us the advantage of
having the range to be as linearly contiguous as possible.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reference: CVE-2015-0275
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/extents.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index bed4308..aa52242 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4803,12 +4803,6 @@ static long ext4_zero_range(struct file *file, loff_t offset,
else
max_blocks -= lblk;
- flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT |
- EXT4_GET_BLOCKS_CONVERT_UNWRITTEN |
- EXT4_EX_NOCACHE;
- if (mode & FALLOC_FL_KEEP_SIZE)
- flags |= EXT4_GET_BLOCKS_KEEP_SIZE;
-
mutex_lock(&inode->i_mutex);
/*
@@ -4825,15 +4819,28 @@ static long ext4_zero_range(struct file *file, loff_t offset,
ret = inode_newsize_ok(inode, new_size);
if (ret)
goto out_mutex;
- /*
- * If we have a partial block after EOF we have to allocate
- * the entire block.
- */
- if (partial_end)
- max_blocks += 1;
}
+ flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT;
+ if (mode & FALLOC_FL_KEEP_SIZE)
+ flags |= EXT4_GET_BLOCKS_KEEP_SIZE;
+
+ /* Preallocate the range including the unaligned edges */
+ if (partial_begin || partial_end) {
+ ret = ext4_alloc_file_blocks(file,
+ round_down(offset, 1 << blkbits) >> blkbits,
+ (round_up((offset + len), 1 << blkbits) -
+ round_down(offset, 1 << blkbits)) >> blkbits,
+ new_size, flags, mode);
+ if (ret)
+ goto out_mutex;
+
+ }
+
+ /* Zero range excluding the unaligned edges */
if (max_blocks > 0) {
+ flags |= (EXT4_GET_BLOCKS_CONVERT_UNWRITTEN |
+ EXT4_EX_NOCACHE);
/* Now release the pages and zero block aligned part of pages*/
truncate_pagecache_range(inode, start, end - 1);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 02/92] x86/microcode/intel: Guard against stack overflow in the loader
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 01/92] ext4: allocate entire range in zero range Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 03/92] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe() Kamal Mostafa
` (89 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Quentin Casasnovas, H. Peter Anvin, Fenghua Yu, Borislav Petkov,
Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Casasnovas <quentin.casasnovas@oracle.com>
commit f84598bd7c851f8b0bf8cd0d7c3be0d73c432ff4 upstream.
mc_saved_tmp is a static array allocated on the stack, we need to make
sure mc_saved_count stays within its bounds, otherwise we're overflowing
the stack in _save_mc(). A specially crafted microcode header could lead
to a kernel crash or potentially kernel execution.
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Link: http://lkml.kernel.org/r/1422964824-22056-1-git-send-email-quentin.casasnovas@oracle.com
Signed-off-by: Borislav Petkov <bp@suse.de>
Reference: CVE-2015-2666
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/kernel/cpu/microcode/intel_early.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/microcode/intel_early.c b/arch/x86/kernel/cpu/microcode/intel_early.c
index ec9df6f..5e109a3 100644
--- a/arch/x86/kernel/cpu/microcode/intel_early.c
+++ b/arch/x86/kernel/cpu/microcode/intel_early.c
@@ -321,7 +321,7 @@ get_matching_model_microcode(int cpu, unsigned long start,
unsigned int mc_saved_count = mc_saved_data->mc_saved_count;
int i;
- while (leftover) {
+ while (leftover && mc_saved_count < ARRAY_SIZE(mc_saved_tmp)) {
mc_header = (struct microcode_header_intel *)ucode_ptr;
mc_size = get_totalsize(mc_header);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 03/92] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe()
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 01/92] ext4: allocate entire range in zero range Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 02/92] x86/microcode/intel: Guard against stack overflow in the loader Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 04/92] ASoC: samsung: s3c24xx-i2s: Fix return value check in s3c24xx_iis_dev_probe() Kamal Mostafa
` (88 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Wei Yongjun, Mark Brown, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
commit 427ced4b203dfea4f08b1298cd1f88e19039fca4 upstream.
In case of error, the function devm_kzalloc() returns NULL
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/codecs/tfa9879.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/tfa9879.c b/sound/soc/codecs/tfa9879.c
index 16f1b71..aab0af6 100644
--- a/sound/soc/codecs/tfa9879.c
+++ b/sound/soc/codecs/tfa9879.c
@@ -280,8 +280,8 @@ static int tfa9879_i2c_probe(struct i2c_client *i2c,
int i;
tfa9879 = devm_kzalloc(&i2c->dev, sizeof(*tfa9879), GFP_KERNEL);
- if (IS_ERR(tfa9879))
- return PTR_ERR(tfa9879);
+ if (!tfa9879)
+ return -ENOMEM;
i2c_set_clientdata(i2c, tfa9879);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 04/92] ASoC: samsung: s3c24xx-i2s: Fix return value check in s3c24xx_iis_dev_probe()
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (2 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 03/92] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe() Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 05/92] ASoC: dapm: Enable autodisable on SOC_DAPM_SINGLE_TLV_AUTODISABLE Kamal Mostafa
` (87 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Wei Yongjun, Mark Brown, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
commit c479163a1b6ab424786fbcd9225b4e3c1c58eb0b upstream.
In case of error, the function devm_ioremap_resource() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/samsung/s3c24xx-i2s.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c
index 326d3c3..5bf7236 100644
--- a/sound/soc/samsung/s3c24xx-i2s.c
+++ b/sound/soc/samsung/s3c24xx-i2s.c
@@ -461,8 +461,8 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev)
return -ENOENT;
}
s3c24xx_i2s.regs = devm_ioremap_resource(&pdev->dev, res);
- if (s3c24xx_i2s.regs == NULL)
- return -ENXIO;
+ if (IS_ERR(s3c24xx_i2s.regs))
+ return PTR_ERR(s3c24xx_i2s.regs);
s3c24xx_i2s_pcm_stereo_out.dma_addr = res->start + S3C2410_IISFIFO;
s3c24xx_i2s_pcm_stereo_in.dma_addr = res->start + S3C2410_IISFIFO;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 05/92] ASoC: dapm: Enable autodisable on SOC_DAPM_SINGLE_TLV_AUTODISABLE
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (3 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 04/92] ASoC: samsung: s3c24xx-i2s: Fix return value check in s3c24xx_iis_dev_probe() Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 06/92] ASoC: rt5677: add register patch for PLL Kamal Mostafa
` (86 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Charles Keepax, Mark Brown, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
commit a2d97723cb3a7741af81868427b36bba274b681b upstream.
Correct small copy and paste error where autodisable was not being
enabled for the SOC_DAPM_SINGLE_TLV_AUTODISABLE control.
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>
---
include/sound/soc-dapm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 89823cf..0ea7a44e 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -287,7 +287,7 @@ struct device;
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
.tlv.p = (tlv_array), \
.get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
- .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
+ .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) }
#define SOC_DAPM_SINGLE_TLV_VIRT(xname, max, tlv_array) \
SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0, tlv_array)
#define SOC_DAPM_ENUM(xname, xenum) \
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 06/92] ASoC: rt5677: add register patch for PLL
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (4 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 05/92] ASoC: dapm: Enable autodisable on SOC_DAPM_SINGLE_TLV_AUTODISABLE Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 07/92] btrfs: unlock i_mutex after attempting to delete subvolume during send Kamal Mostafa
` (85 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Bard Liao, Mark Brown, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Bard Liao <bardliao@realtek.com>
commit 74d6ea52aeef0236242221c6eff6d892565c5a92 upstream.
The PLL output will be unstable in some cases. We can fix it by
setting some registers.
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/codecs/rt5677.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index cc90988..9ce6b65 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -62,6 +62,9 @@ static const struct reg_default init_list[] = {
{RT5677_PR_BASE + 0x1e, 0x0000},
{RT5677_PR_BASE + 0x12, 0x0eaa},
{RT5677_PR_BASE + 0x14, 0x018a},
+ {RT5677_PR_BASE + 0x15, 0x0490},
+ {RT5677_PR_BASE + 0x38, 0x0f71},
+ {RT5677_PR_BASE + 0x39, 0x0f71},
};
#define RT5677_INIT_REG_LEN ARRAY_SIZE(init_list)
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 07/92] btrfs: unlock i_mutex after attempting to delete subvolume during send
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (5 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 06/92] ASoC: rt5677: add register patch for PLL Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 08/92] ALSA: hda - Fix mute-LED fixed mode Kamal Mostafa
` (84 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Omar Sandoval, Chris Mason, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Omar Sandoval <osandov@osandov.com>
commit 909e26dce3f7600f5e293ac0522c28790a0c8c9c upstream.
Whenever the check for a send in progress introduced in commit
521e0546c970 (btrfs: protect snapshots from deleting during send) is
hit, we return without unlocking inode->i_mutex. This is easy to see
with lockdep enabled:
[ +0.000059] ================================================
[ +0.000028] [ BUG: lock held when returning to user space! ]
[ +0.000029] 4.0.0-rc5-00096-g3c435c1 #93 Not tainted
[ +0.000026] ------------------------------------------------
[ +0.000029] btrfs/211 is leaving the kernel with locks still held!
[ +0.000029] 1 lock held by btrfs/211:
[ +0.000023] #0: (&type->i_mutex_dir_key){+.+.+.}, at: [<ffffffff8135b8df>] btrfs_ioctl_snap_destroy+0x2df/0x7a0
Make sure we unlock it in the error path.
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/btrfs/ioctl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 09a566a..334b0a9 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2403,7 +2403,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
"Attempt to delete subvolume %llu during send",
dest->root_key.objectid);
err = -EPERM;
- goto out_dput;
+ goto out_unlock_inode;
}
d_invalidate(dentry);
@@ -2498,6 +2498,7 @@ out_up_write:
root_flags & ~BTRFS_ROOT_SUBVOL_DEAD);
spin_unlock(&dest->root_item_lock);
}
+out_unlock_inode:
mutex_unlock(&inode->i_mutex);
if (!err) {
shrink_dcache_sb(root->fs_info->sb);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 08/92] ALSA: hda - Fix mute-LED fixed mode
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (6 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 07/92] btrfs: unlock i_mutex after attempting to delete subvolume during send Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 09/92] ALSA: hda - Add mute-LED mode control to Thinkpad Kamal Mostafa
` (83 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit ee52e56e7b12834476cd0031c5986254ba1b6317 upstream.
The mute-LED mode control has the fixed on/off states that are
supposed to remain on/off regardless of the master switch. However,
this doesn't work actually because the vmaster hook is called in the
vmaster code itself.
This patch fixes it by calling the hook indirectly after checking the
mute LED mode.
Reported-and-tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/hda_codec.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 2fe86d2..a63a863 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -3027,6 +3027,16 @@ static struct snd_kcontrol_new vmaster_mute_mode = {
.put = vmaster_mute_mode_put,
};
+/* meta hook to call each driver's vmaster hook */
+static void vmaster_hook(void *private_data, int enabled)
+{
+ struct hda_vmaster_mute_hook *hook = private_data;
+
+ if (hook->mute_mode != HDA_VMUTE_FOLLOW_MASTER)
+ enabled = hook->mute_mode;
+ hook->hook(hook->codec, enabled);
+}
+
/**
* snd_hda_add_vmaster_hook - Add a vmaster hook for mute-LED
* @codec: the HDA codec
@@ -3045,9 +3055,9 @@ int snd_hda_add_vmaster_hook(struct hda_codec *codec,
if (!hook->hook || !hook->sw_kctl)
return 0;
- snd_ctl_add_vmaster_hook(hook->sw_kctl, hook->hook, codec);
hook->codec = codec;
hook->mute_mode = HDA_VMUTE_FOLLOW_MASTER;
+ snd_ctl_add_vmaster_hook(hook->sw_kctl, vmaster_hook, hook);
if (!expose_enum_ctl)
return 0;
kctl = snd_ctl_new1(&vmaster_mute_mode, hook);
@@ -3073,14 +3083,7 @@ void snd_hda_sync_vmaster_hook(struct hda_vmaster_mute_hook *hook)
*/
if (hook->codec->bus->shutdown)
return;
- switch (hook->mute_mode) {
- case HDA_VMUTE_FOLLOW_MASTER:
- snd_ctl_sync_vmaster_hook(hook->sw_kctl);
- break;
- default:
- hook->hook(hook->codec, hook->mute_mode);
- break;
- }
+ snd_ctl_sync_vmaster_hook(hook->sw_kctl);
}
EXPORT_SYMBOL_GPL(snd_hda_sync_vmaster_hook);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 09/92] ALSA: hda - Add mute-LED mode control to Thinkpad
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (7 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 08/92] ALSA: hda - Fix mute-LED fixed mode Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 10/92] arm64: dma-mapping: always clear allocated buffers Kamal Mostafa
` (82 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 7290006d8c0900c56d8c58428134f02c35109d17 upstream.
This patch adds the missing flag to enable "Mute-LED Mode" mixer enum
ctl for Thinkpads that have also the software mute-LED control.
Reported-and-tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/hda/thinkpad_helper.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/pci/hda/thinkpad_helper.c b/sound/pci/hda/thinkpad_helper.c
index 6ba0b55..2341fc3 100644
--- a/sound/pci/hda/thinkpad_helper.c
+++ b/sound/pci/hda/thinkpad_helper.c
@@ -72,6 +72,7 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
if (led_set_func(TPACPI_LED_MUTE, false) >= 0) {
old_vmaster_hook = spec->vmaster_mute.hook;
spec->vmaster_mute.hook = update_tpacpi_mute_led;
+ spec->vmaster_mute_enum = 1;
removefunc = false;
}
if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) {
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 10/92] arm64: dma-mapping: always clear allocated buffers
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (8 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 09/92] ALSA: hda - Add mute-LED mode control to Thinkpad Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 11/92] ALSA: emu10k1: Fix card shortname string buffer overflow Kamal Mostafa
` (81 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Marek Szyprowski, Will Deacon, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Szyprowski <m.szyprowski@samsung.com>
commit 6829e274a623187c24f7cfc0e3d35f25d087fcc5 upstream.
Buffers allocated by dma_alloc_coherent() are always zeroed on Alpha,
ARM (32bit), MIPS, PowerPC, x86/x86_64 and probably other architectures.
It turned out that some drivers rely on this 'feature'. Allocated buffer
might be also exposed to userspace with dma_mmap() call, so clearing it
is desired from security point of view to avoid exposing random memory
to userspace. This patch unifies dma_alloc_coherent() behavior on ARM64
architecture with other implementations by unconditionally zeroing
allocated buffer.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/mm/dma-mapping.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index df34a70..6efbb52 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -67,8 +67,7 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page, gfp_t flags)
*ret_page = phys_to_page(phys);
ptr = (void *)val;
- if (flags & __GFP_ZERO)
- memset(ptr, 0, size);
+ memset(ptr, 0, size);
}
return ptr;
@@ -113,8 +112,7 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size,
*dma_handle = phys_to_dma(dev, page_to_phys(page));
addr = page_address(page);
- if (flags & __GFP_ZERO)
- memset(addr, 0, size);
+ memset(addr, 0, size);
return addr;
} else {
return swiotlb_alloc_coherent(dev, size, dma_handle, flags);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 11/92] ALSA: emu10k1: Fix card shortname string buffer overflow
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (9 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 10/92] arm64: dma-mapping: always clear allocated buffers Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 12/92] ALSA: emux: Fix mutex deadlock at unloading Kamal Mostafa
` (80 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit d02260824e2cad626fb2a9d62e27006d34b6dedc upstream.
Some models provide too long string for the shortname that has 32bytes
including the terminator, and it results in a non-terminated string
exposed to the user-space. This isn't too critical, though, as the
string is stopped at the succeeding longname string.
This patch fixes such entries by dropping "SB" prefix (it's enough to
fit within 32 bytes, so far). Meanwhile, it also changes strcpy()
with strlcpy() to make sure that this kind of problem won't happen in
future, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/pci/emu10k1/emu10k1.c | 6 ++++--
sound/pci/emu10k1/emu10k1_main.c | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 4c17163..a432b4c 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -183,8 +183,10 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci,
}
#endif
- strcpy(card->driver, emu->card_capabilities->driver);
- strcpy(card->shortname, emu->card_capabilities->name);
+ strlcpy(card->driver, emu->card_capabilities->driver,
+ sizeof(card->driver));
+ strlcpy(card->shortname, emu->card_capabilities->name,
+ sizeof(card->shortname));
snprintf(card->longname, sizeof(card->longname),
"%s (rev.%d, serial:0x%x) at 0x%lx, irq %i",
card->shortname, emu->revision, emu->serial, emu->port, emu->irq);
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index b4458a6..ddaba4d 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -1421,7 +1421,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
*
*/
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x20011102,
- .driver = "Audigy2", .name = "SB Audigy 2 ZS Notebook [SB0530]",
+ .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1571,7 +1571,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.adc_1361t = 1, /* 24 bit capture instead of 16bit */
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10051102,
- .driver = "Audigy2", .name = "SB Audigy 2 Platinum EX [SB0280]",
+ .driver = "Audigy2", .name = "Audigy 2 Platinum EX [SB0280]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 12/92] ALSA: emux: Fix mutex deadlock at unloading
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (10 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 11/92] ALSA: emu10k1: Fix card shortname string buffer overflow Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 13/92] drm/radeon: Use drm_calloc_ab for CS relocs Kamal Mostafa
` (79 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 07b0e5d49d227e3950cb13a3e8caf248ef2a310e upstream.
The emux-synth driver has a possible AB/BA mutex deadlock at unloading
the emu10k1 driver:
snd_emux_free() ->
snd_emux_detach_seq(): mutex_lock(&emu->register_mutex) ->
snd_seq_delete_kernel_client() ->
snd_seq_free_client(): mutex_lock(®ister_mutex)
snd_seq_release() ->
snd_seq_free_client(): mutex_lock(®ister_mutex) ->
snd_seq_delete_all_ports() ->
snd_emux_unuse(): mutex_lock(&emu->register_mutex)
Basically snd_emux_detach_seq() doesn't need a protection of
emu->register_mutex as it's already being unregistered. So, we can
get rid of this for avoiding the deadlock.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/synth/emux/emux_seq.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index 7778b8e..188fda0e 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -124,12 +124,10 @@ snd_emux_detach_seq(struct snd_emux *emu)
if (emu->voices)
snd_emux_terminate_all(emu);
- mutex_lock(&emu->register_mutex);
if (emu->client >= 0) {
snd_seq_delete_kernel_client(emu->client);
emu->client = -1;
}
- mutex_unlock(&emu->register_mutex);
}
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 13/92] drm/radeon: Use drm_calloc_ab for CS relocs
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (11 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 12/92] ALSA: emux: Fix mutex deadlock at unloading Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 14/92] drm/radeon: adjust pll when audio is not enabled Kamal Mostafa
` (78 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michel Dänzer, Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
commit b421ed15d2c3039eb724680e4de1e4b2bd196a9a upstream.
The number of relocs is passed in by userspace and can be large. It has
been observed to cause kcalloc failures in the wild.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_cs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 26e7d28..204a64a 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -88,7 +88,7 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
p->dma_reloc_idx = 0;
/* FIXME: we assume that each relocs use 4 dwords */
p->nrelocs = chunk->length_dw / 4;
- p->relocs = kcalloc(p->nrelocs, sizeof(struct radeon_bo_list), GFP_KERNEL);
+ p->relocs = drm_calloc_large(p->nrelocs, sizeof(struct radeon_bo_list));
if (p->relocs == NULL) {
return -ENOMEM;
}
@@ -428,7 +428,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error, bo
}
}
kfree(parser->track);
- kfree(parser->relocs);
+ drm_free_large(parser->relocs);
drm_free_large(parser->vm_bos);
for (i = 0; i < parser->nchunks; i++)
drm_free_large(parser->chunks[i].kdata);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 14/92] drm/radeon: adjust pll when audio is not enabled
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (12 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 13/92] drm/radeon: Use drm_calloc_ab for CS relocs Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 15/92] drm/radeon: add SI DPM quirk for Sapphire R9 270 Dual-X 2G GDDR5 Kamal Mostafa
` (77 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit 7fe04d6fa824ccea704535a597dc417c8687f990 upstream.
Fixes display problems with some monitors when audio
is not enabled.
Bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=89505
https://bugzilla.kernel.org/show_bug.cgi?id=94171
Plus several reports on IRC.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/atombios_crtc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 9bd5611..1afc0b4 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -580,6 +580,9 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
else
radeon_crtc->pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
+ /* if there is no audio, set MINM_OVER_MAXP */
+ if (!drm_detect_monitor_audio(radeon_connector_edid(connector)))
+ radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
if (rdev->family < CHIP_RV770)
radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
/* use frac fb div on APUs */
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 15/92] drm/radeon: add SI DPM quirk for Sapphire R9 270 Dual-X 2G GDDR5
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (13 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 14/92] drm/radeon: adjust pll when audio is not enabled Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 16/92] drm/radeon: fix lockup when BOs aren't part of the VM on release Kamal Mostafa
` (76 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit cd17e02ff4db58ec32d35cf331c705d295779930 upstream.
Seems to have problems with high mclks.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=76490
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/si_dpm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index eff8a64..50313d7 100644
--- a/drivers/gpu/drm/radeon/si_dpm.c
+++ b/drivers/gpu/drm/radeon/si_dpm.c
@@ -2921,6 +2921,7 @@ struct si_dpm_quirk {
static struct si_dpm_quirk si_dpm_quirk_list[] = {
/* PITCAIRN - https://bugs.freedesktop.org/show_bug.cgi?id=76490 */
{ PCI_VENDOR_ID_ATI, 0x6810, 0x1462, 0x3036, 0, 120000 },
+ { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0xe271, 0, 120000 },
{ 0, 0, 0, 0 },
};
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 16/92] drm/radeon: fix lockup when BOs aren't part of the VM on release
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (14 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 15/92] drm/radeon: add SI DPM quirk for Sapphire R9 270 Dual-X 2G GDDR5 Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 17/92] drm/radeon: reset BOs address after clearing it Kamal Mostafa
` (75 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christian König, Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
commit 26d4d129b6042197b4cbc8341c0618f99231af2f upstream.
If we unmap BOs before releasing them them the intervall tree locks
up because we try to remove an entry not inside the tree.
Based on a patch from Michel Dänzer.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_vm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index 2a5a4a9..16d8e95 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -1107,7 +1107,8 @@ void radeon_vm_bo_rmv(struct radeon_device *rdev,
list_del(&bo_va->bo_list);
mutex_lock(&vm->mutex);
- interval_tree_remove(&bo_va->it, &vm->va);
+ if (bo_va->it.start || bo_va->it.last)
+ interval_tree_remove(&bo_va->it, &vm->va);
spin_lock(&vm->status_lock);
list_del(&bo_va->vm_status);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 17/92] drm/radeon: reset BOs address after clearing it.
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (15 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 16/92] drm/radeon: fix lockup when BOs aren't part of the VM on release Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 18/92] drm/radeon: check new address before removing old one Kamal Mostafa
` (74 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christian König, Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
commit 48afbd70ac7b6aa62e8d452091023941d8085f8a upstream.
Otherwise it is possible that we will have page table corruption
if we change a BOs address multiple times.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_vm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index 16d8e95..cabcb0a 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -490,6 +490,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
spin_lock(&vm->status_lock);
list_add(&tmp->vm_status, &vm->freed);
spin_unlock(&vm->status_lock);
+
+ bo_va->addr = 0;
}
interval_tree_remove(&bo_va->it, &vm->va);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 18/92] drm/radeon: check new address before removing old one
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (16 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 17/92] drm/radeon: reset BOs address after clearing it Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 19/92] SCSI: add 1024 max sectors black list flag Kamal Mostafa
` (73 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christian König, Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
commit c29c0876ec05d51a93508a39b90b92c29ba6423d upstream.
Otherwise the change isn't atomic.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_vm.c | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index cabcb0a..de42fc4 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -473,6 +473,23 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
}
mutex_lock(&vm->mutex);
+ soffset /= RADEON_GPU_PAGE_SIZE;
+ eoffset /= RADEON_GPU_PAGE_SIZE;
+ if (soffset || eoffset) {
+ struct interval_tree_node *it;
+ it = interval_tree_iter_first(&vm->va, soffset, eoffset - 1);
+ if (it && it != &bo_va->it) {
+ struct radeon_bo_va *tmp;
+ tmp = container_of(it, struct radeon_bo_va, it);
+ /* bo and tmp overlap, invalid offset */
+ dev_err(rdev->dev, "bo %p va 0x%010Lx conflict with "
+ "(bo %p 0x%010lx 0x%010lx)\n", bo_va->bo,
+ soffset, tmp->bo, tmp->it.start, tmp->it.last);
+ mutex_unlock(&vm->mutex);
+ return -EINVAL;
+ }
+ }
+
if (bo_va->it.start || bo_va->it.last) {
if (bo_va->addr) {
/* add a clone of the bo_va to clear the old address */
@@ -499,21 +516,7 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
bo_va->it.last = 0;
}
- soffset /= RADEON_GPU_PAGE_SIZE;
- eoffset /= RADEON_GPU_PAGE_SIZE;
if (soffset || eoffset) {
- struct interval_tree_node *it;
- it = interval_tree_iter_first(&vm->va, soffset, eoffset - 1);
- if (it) {
- struct radeon_bo_va *tmp;
- tmp = container_of(it, struct radeon_bo_va, it);
- /* bo and tmp overlap, invalid offset */
- dev_err(rdev->dev, "bo %p va 0x%010Lx conflict with "
- "(bo %p 0x%010lx 0x%010lx)\n", bo_va->bo,
- soffset, tmp->bo, tmp->it.start, tmp->it.last);
- mutex_unlock(&vm->mutex);
- return -EINVAL;
- }
bo_va->it.start = soffset;
bo_va->it.last = eoffset - 1;
interval_tree_insert(&bo_va->it, &vm->va);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 19/92] SCSI: add 1024 max sectors black list flag
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (17 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 18/92] drm/radeon: check new address before removing old one Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 20/92] 3w-sas: fix command completion race Kamal Mostafa
` (72 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mike Christie, James Bottomley, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Christie <michaelc@cs.wisc.edu>
commit 35e9a9f93994d7f7d12afa41169c7ba05513721b upstream.
This works around a issue with qnap iscsi targets not handling large IOs
very well.
The target returns:
VPD INQUIRY: Block limits page (SBC)
Maximum compare and write length: 1 blocks
Optimal transfer length granularity: 1 blocks
Maximum transfer length: 4294967295 blocks
Optimal transfer length: 4294967295 blocks
Maximum prefetch, xdread, xdwrite transfer length: 0 blocks
Maximum unmap LBA count: 8388607
Maximum unmap block descriptor count: 1
Optimal unmap granularity: 16383
Unmap granularity alignment valid: 0
Unmap granularity alignment: 0
Maximum write same length: 0xffffffff blocks
Maximum atomic transfer length: 0
Atomic alignment: 0
Atomic transfer length granularity: 0
and it is *sometimes* able to handle at least one IO of size up to 8 MB. We
have seen in traces where it will sometimes work, but other times it
looks like it fails and it looks like it returns failures if we send
multiple large IOs sometimes. Also it looks like it can return 2 different
errors. It will sometimes send iscsi reject errors indicating out of
resources or it will send invalid cdb illegal requests check conditions.
And then when it sends iscsi rejects it does not seem to handle retries
when there are command sequence holes, so I could not just add code to
try and gracefully handle that error code.
The problem is that we do not have a good contact for the company,
so we are not able to determine under what conditions it returns
which error and why it sometimes works.
So, this patch just adds a new black list flag to set targets like this to
the old max safe sectors of 1024. The max_hw_sectors changes added in 3.19
caused this regression, so I also ccing stable.
Reported-by: Christian Hesse <list@eworm.de>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/scsi_devinfo.c | 1 +
drivers/scsi/scsi_scan.c | 6 ++++++
include/scsi/scsi_devinfo.h | 1 +
3 files changed, 8 insertions(+)
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 262ab83..9f77d23 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -226,6 +226,7 @@ static struct {
{"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"Promise", "VTrak E610f", NULL, BLIST_SPARSELUN | BLIST_NO_RSOC},
{"Promise", "", NULL, BLIST_SPARSELUN},
+ {"QNAP", "iSCSI Storage", NULL, BLIST_MAX_1024},
{"QUANTUM", "XP34301", "1071", BLIST_NOTQ},
{"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN},
{"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN},
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 983aed1..cc662c9 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -909,6 +909,12 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
*/
if (*bflags & BLIST_MAX_512)
blk_queue_max_hw_sectors(sdev->request_queue, 512);
+ /*
+ * Max 1024 sector transfer length for targets that report incorrect
+ * max/optimal lengths and relied on the old block layer safe default
+ */
+ else if (*bflags & BLIST_MAX_1024)
+ blk_queue_max_hw_sectors(sdev->request_queue, 1024);
/*
* Some devices may not want to have a start command automatically
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index 183eaab..96e3f56 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -36,5 +36,6 @@
for sequential scan */
#define BLIST_TRY_VPD_PAGES 0x10000000 /* Attempt to read VPD pages */
#define BLIST_NO_RSOC 0x20000000 /* don't try to issue RSOC */
+#define BLIST_MAX_1024 0x40000000 /* maximum 1024 sector cdb length */
#endif
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 20/92] 3w-sas: fix command completion race
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (18 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 19/92] SCSI: add 1024 max sectors black list flag Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 21/92] 3w-xxxx: " Kamal Mostafa
` (71 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christoph Hellwig, James Bottomley, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <hch@lst.de>
commit 579d69bc1fd56d5af5761969aa529d1d1c188300 upstream.
The 3w-sas driver needs to tear down the dma mappings before returning
the command to the midlayer, as there is no guarantee the sglist and
count are valid after that point. Also remove the dma mapping helpers
which have another inherent race due to the request_id index.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Torsten Luettgert <ml-lkml@enda.eu>
Tested-by: Bernd Kardatzki <Bernd.Kardatzki@med.uni-tuebingen.de>
Acked-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/3w-sas.c | 50 ++++++++++----------------------------------------
drivers/scsi/3w-sas.h | 4 ----
2 files changed, 10 insertions(+), 44 deletions(-)
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index 2361772..f837485 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -290,26 +290,6 @@ static int twl_post_command_packet(TW_Device_Extension *tw_dev, int request_id)
return 0;
} /* End twl_post_command_packet() */
-/* This function will perform a pci-dma mapping for a scatter gather list */
-static int twl_map_scsi_sg_data(TW_Device_Extension *tw_dev, int request_id)
-{
- int use_sg;
- struct scsi_cmnd *cmd = tw_dev->srb[request_id];
-
- use_sg = scsi_dma_map(cmd);
- if (!use_sg)
- return 0;
- else if (use_sg < 0) {
- TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1, "Failed to map scatter gather list");
- return 0;
- }
-
- cmd->SCp.phase = TW_PHASE_SGLIST;
- cmd->SCp.have_data_in = use_sg;
-
- return use_sg;
-} /* End twl_map_scsi_sg_data() */
-
/* This function hands scsi cdb's to the firmware */
static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry_ISO *sglistarg)
{
@@ -357,8 +337,8 @@ static int twl_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
if (!sglistarg) {
/* Map sglist from scsi layer to cmd packet */
if (scsi_sg_count(srb)) {
- sg_count = twl_map_scsi_sg_data(tw_dev, request_id);
- if (sg_count == 0)
+ sg_count = scsi_dma_map(srb);
+ if (sg_count <= 0)
goto out;
scsi_for_each_sg(srb, sg, sg_count, i) {
@@ -1102,15 +1082,6 @@ out:
return retval;
} /* End twl_initialize_device_extension() */
-/* This function will perform a pci-dma unmap */
-static void twl_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id)
-{
- struct scsi_cmnd *cmd = tw_dev->srb[request_id];
-
- if (cmd->SCp.phase == TW_PHASE_SGLIST)
- scsi_dma_unmap(cmd);
-} /* End twl_unmap_scsi_data() */
-
/* This function will handle attention interrupts */
static int twl_handle_attention_interrupt(TW_Device_Extension *tw_dev)
{
@@ -1251,11 +1222,11 @@ static irqreturn_t twl_interrupt(int irq, void *dev_instance)
}
/* Now complete the io */
+ scsi_dma_unmap(cmd);
+ cmd->scsi_done(cmd);
tw_dev->state[request_id] = TW_S_COMPLETED;
twl_free_request_id(tw_dev, request_id);
tw_dev->posted_request_count--;
- tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
- twl_unmap_scsi_data(tw_dev, request_id);
}
/* Check for another response interrupt */
@@ -1400,10 +1371,12 @@ static int twl_reset_device_extension(TW_Device_Extension *tw_dev, int ioctl_res
if ((tw_dev->state[i] != TW_S_FINISHED) &&
(tw_dev->state[i] != TW_S_INITIAL) &&
(tw_dev->state[i] != TW_S_COMPLETED)) {
- if (tw_dev->srb[i]) {
- tw_dev->srb[i]->result = (DID_RESET << 16);
- tw_dev->srb[i]->scsi_done(tw_dev->srb[i]);
- twl_unmap_scsi_data(tw_dev, i);
+ struct scsi_cmnd *cmd = tw_dev->srb[i];
+
+ if (cmd) {
+ cmd->result = (DID_RESET << 16);
+ scsi_dma_unmap(cmd);
+ cmd->scsi_done(cmd);
}
}
}
@@ -1507,9 +1480,6 @@ static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_
/* Save the scsi command for use by the ISR */
tw_dev->srb[request_id] = SCpnt;
- /* Initialize phase to zero */
- SCpnt->SCp.phase = TW_PHASE_INITIAL;
-
retval = twl_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL);
if (retval) {
tw_dev->state[request_id] = TW_S_COMPLETED;
diff --git a/drivers/scsi/3w-sas.h b/drivers/scsi/3w-sas.h
index d474892..fec6449 100644
--- a/drivers/scsi/3w-sas.h
+++ b/drivers/scsi/3w-sas.h
@@ -103,10 +103,6 @@ static char *twl_aen_severity_table[] =
#define TW_CURRENT_DRIVER_BUILD 0
#define TW_CURRENT_DRIVER_BRANCH 0
-/* Phase defines */
-#define TW_PHASE_INITIAL 0
-#define TW_PHASE_SGLIST 2
-
/* Misc defines */
#define TW_SECTOR_SIZE 512
#define TW_MAX_UNITS 32
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 21/92] 3w-xxxx: fix command completion race
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (19 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 20/92] 3w-sas: fix command completion race Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 22/92] 3w-9xxx: " Kamal Mostafa
` (70 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christoph Hellwig, James Bottomley, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <hch@lst.de>
commit 9cd9554615cba14f0877cc9972a6537ad2bdde61 upstream.
The 3w-xxxx driver needs to tear down the dma mappings before returning
the command to the midlayer, as there is no guarantee the sglist and
count are valid after that point. Also remove the dma mapping helpers
which have another inherent race due to the request_id index.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/3w-xxxx.c | 42 ++++++------------------------------------
drivers/scsi/3w-xxxx.h | 5 -----
2 files changed, 6 insertions(+), 41 deletions(-)
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index c75f204..2940bd7 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -1271,32 +1271,6 @@ static int tw_initialize_device_extension(TW_Device_Extension *tw_dev)
return 0;
} /* End tw_initialize_device_extension() */
-static int tw_map_scsi_sg_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
-{
- int use_sg;
-
- dprintk(KERN_WARNING "3w-xxxx: tw_map_scsi_sg_data()\n");
-
- use_sg = scsi_dma_map(cmd);
- if (use_sg < 0) {
- printk(KERN_WARNING "3w-xxxx: tw_map_scsi_sg_data(): pci_map_sg() failed.\n");
- return 0;
- }
-
- cmd->SCp.phase = TW_PHASE_SGLIST;
- cmd->SCp.have_data_in = use_sg;
-
- return use_sg;
-} /* End tw_map_scsi_sg_data() */
-
-static void tw_unmap_scsi_data(struct pci_dev *pdev, struct scsi_cmnd *cmd)
-{
- dprintk(KERN_WARNING "3w-xxxx: tw_unmap_scsi_data()\n");
-
- if (cmd->SCp.phase == TW_PHASE_SGLIST)
- scsi_dma_unmap(cmd);
-} /* End tw_unmap_scsi_data() */
-
/* This function will reset a device extension */
static int tw_reset_device_extension(TW_Device_Extension *tw_dev)
{
@@ -1319,8 +1293,8 @@ static int tw_reset_device_extension(TW_Device_Extension *tw_dev)
srb = tw_dev->srb[i];
if (srb != NULL) {
srb->result = (DID_RESET << 16);
- tw_dev->srb[i]->scsi_done(tw_dev->srb[i]);
- tw_unmap_scsi_data(tw_dev->tw_pci_dev, tw_dev->srb[i]);
+ scsi_dma_unmap(srb);
+ srb->scsi_done(srb);
}
}
}
@@ -1767,8 +1741,8 @@ static int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id)
command_packet->byte8.io.lba = lba;
command_packet->byte6.block_count = num_sectors;
- use_sg = tw_map_scsi_sg_data(tw_dev->tw_pci_dev, tw_dev->srb[request_id]);
- if (!use_sg)
+ use_sg = scsi_dma_map(srb);
+ if (use_sg <= 0)
return 1;
scsi_for_each_sg(tw_dev->srb[request_id], sg, use_sg, i) {
@@ -1955,9 +1929,6 @@ static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_c
/* Save the scsi command for use by the ISR */
tw_dev->srb[request_id] = SCpnt;
- /* Initialize phase to zero */
- SCpnt->SCp.phase = TW_PHASE_INITIAL;
-
switch (*command) {
case READ_10:
case READ_6:
@@ -2185,12 +2156,11 @@ static irqreturn_t tw_interrupt(int irq, void *dev_instance)
/* Now complete the io */
if ((error != TW_ISR_DONT_COMPLETE)) {
+ scsi_dma_unmap(tw_dev->srb[request_id]);
+ tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
tw_dev->state[request_id] = TW_S_COMPLETED;
tw_state_request_finish(tw_dev, request_id);
tw_dev->posted_request_count--;
- tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
-
- tw_unmap_scsi_data(tw_dev->tw_pci_dev, tw_dev->srb[request_id]);
}
}
diff --git a/drivers/scsi/3w-xxxx.h b/drivers/scsi/3w-xxxx.h
index 29b0b84e..6f65e66 100644
--- a/drivers/scsi/3w-xxxx.h
+++ b/drivers/scsi/3w-xxxx.h
@@ -195,11 +195,6 @@ static unsigned char tw_sense_table[][4] =
#define TW_AEN_SMART_FAIL 0x000F
#define TW_AEN_SBUF_FAIL 0x0024
-/* Phase defines */
-#define TW_PHASE_INITIAL 0
-#define TW_PHASE_SINGLE 1
-#define TW_PHASE_SGLIST 2
-
/* Misc defines */
#define TW_ALIGNMENT_6000 64 /* 64 bytes */
#define TW_ALIGNMENT_7000 4 /* 4 bytes */
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 22/92] 3w-9xxx: fix command completion race
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (20 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 21/92] 3w-xxxx: " Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 23/92] uas: Allow uas_use_uas_driver to return usb-storage flags Kamal Mostafa
` (69 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christoph Hellwig, James Bottomley, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <hch@lst.de>
commit 118c855b5623f3e2e6204f02623d88c09e0c34de upstream.
The 3w-9xxx driver needs to tear down the dma mappings before returning
the command to the midlayer, as there is no guarantee the sglist and
count are valid after that point. Also remove the dma mapping helpers
which have another inherent race due to the request_id index.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/scsi/3w-9xxx.c | 57 ++++++++++++--------------------------------------
drivers/scsi/3w-9xxx.h | 5 -----
2 files changed, 13 insertions(+), 49 deletions(-)
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index cd4129f..1f9e8d2 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -149,7 +149,6 @@ static int twa_reset_sequence(TW_Device_Extension *tw_dev, int soft_reset);
static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg);
static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int request_id);
static char *twa_string_lookup(twa_message_type *table, unsigned int aen_code);
-static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id);
/* Functions */
@@ -1339,11 +1338,11 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
}
/* Now complete the io */
+ scsi_dma_unmap(cmd);
+ cmd->scsi_done(cmd);
tw_dev->state[request_id] = TW_S_COMPLETED;
twa_free_request_id(tw_dev, request_id);
tw_dev->posted_request_count--;
- tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
- twa_unmap_scsi_data(tw_dev, request_id);
}
/* Check for valid status after each drain */
@@ -1401,26 +1400,6 @@ static void twa_load_sgl(TW_Device_Extension *tw_dev, TW_Command_Full *full_comm
}
} /* End twa_load_sgl() */
-/* This function will perform a pci-dma mapping for a scatter gather list */
-static int twa_map_scsi_sg_data(TW_Device_Extension *tw_dev, int request_id)
-{
- int use_sg;
- struct scsi_cmnd *cmd = tw_dev->srb[request_id];
-
- use_sg = scsi_dma_map(cmd);
- if (!use_sg)
- return 0;
- else if (use_sg < 0) {
- TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1c, "Failed to map scatter gather list");
- return 0;
- }
-
- cmd->SCp.phase = TW_PHASE_SGLIST;
- cmd->SCp.have_data_in = use_sg;
-
- return use_sg;
-} /* End twa_map_scsi_sg_data() */
-
/* This function will poll for a response interrupt of a request */
static int twa_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds)
{
@@ -1599,9 +1578,11 @@ static int twa_reset_device_extension(TW_Device_Extension *tw_dev)
(tw_dev->state[i] != TW_S_INITIAL) &&
(tw_dev->state[i] != TW_S_COMPLETED)) {
if (tw_dev->srb[i]) {
- tw_dev->srb[i]->result = (DID_RESET << 16);
- tw_dev->srb[i]->scsi_done(tw_dev->srb[i]);
- twa_unmap_scsi_data(tw_dev, i);
+ struct scsi_cmnd *cmd = tw_dev->srb[i];
+
+ cmd->result = (DID_RESET << 16);
+ scsi_dma_unmap(cmd);
+ cmd->scsi_done(cmd);
}
}
}
@@ -1780,21 +1761,18 @@ static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_
/* Save the scsi command for use by the ISR */
tw_dev->srb[request_id] = SCpnt;
- /* Initialize phase to zero */
- SCpnt->SCp.phase = TW_PHASE_INITIAL;
-
retval = twa_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL);
switch (retval) {
case SCSI_MLQUEUE_HOST_BUSY:
+ scsi_dma_unmap(SCpnt);
twa_free_request_id(tw_dev, request_id);
- twa_unmap_scsi_data(tw_dev, request_id);
break;
case 1:
- tw_dev->state[request_id] = TW_S_COMPLETED;
- twa_free_request_id(tw_dev, request_id);
- twa_unmap_scsi_data(tw_dev, request_id);
SCpnt->result = (DID_ERROR << 16);
+ scsi_dma_unmap(SCpnt);
done(SCpnt);
+ tw_dev->state[request_id] = TW_S_COMPLETED;
+ twa_free_request_id(tw_dev, request_id);
retval = 0;
}
out:
@@ -1862,8 +1840,8 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
command_packet->sg_list[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]);
command_packet->sg_list[0].length = cpu_to_le32(TW_MIN_SGL_LENGTH);
} else {
- sg_count = twa_map_scsi_sg_data(tw_dev, request_id);
- if (sg_count == 0)
+ sg_count = scsi_dma_map(srb);
+ if (sg_count < 0)
goto out;
scsi_for_each_sg(srb, sg, sg_count, i) {
@@ -1978,15 +1956,6 @@ static char *twa_string_lookup(twa_message_type *table, unsigned int code)
return(table[index].text);
} /* End twa_string_lookup() */
-/* This function will perform a pci-dma unmap */
-static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id)
-{
- struct scsi_cmnd *cmd = tw_dev->srb[request_id];
-
- if (cmd->SCp.phase == TW_PHASE_SGLIST)
- scsi_dma_unmap(cmd);
-} /* End twa_unmap_scsi_data() */
-
/* This function gets called when a disk is coming on-line */
static int twa_slave_configure(struct scsi_device *sdev)
{
diff --git a/drivers/scsi/3w-9xxx.h b/drivers/scsi/3w-9xxx.h
index 040f721..0fdc83c 100644
--- a/drivers/scsi/3w-9xxx.h
+++ b/drivers/scsi/3w-9xxx.h
@@ -324,11 +324,6 @@ static twa_message_type twa_error_table[] = {
#define TW_CURRENT_DRIVER_BUILD 0
#define TW_CURRENT_DRIVER_BRANCH 0
-/* Phase defines */
-#define TW_PHASE_INITIAL 0
-#define TW_PHASE_SINGLE 1
-#define TW_PHASE_SGLIST 2
-
/* Misc defines */
#define TW_9550SX_DRAIN_COMPLETED 0xFFFF
#define TW_SECTOR_SIZE 512
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 23/92] uas: Allow uas_use_uas_driver to return usb-storage flags
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (21 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 22/92] 3w-9xxx: " Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 24/92] uas: Add US_FL_MAX_SECTORS_240 flag Kamal Mostafa
` (68 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <hdegoede@redhat.com>
commit a5011d44f0e1117a6db14b19b57c51f8be5673a0 upstream.
uas_use_uas_driver may set some US_FL_foo flags during detection, currently
these are stored in a local variable and then throw away, but these may be
of interest to the caller, so add an extra parameter to (optionally) return
the detected flags, and use this in the uas driver.
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/storage/uas-detect.h | 6 +++++-
drivers/usb/storage/uas.c | 6 +++---
drivers/usb/storage/usb.c | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
index 9893d69..63ae161 100644
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -51,7 +51,8 @@ static int uas_find_endpoints(struct usb_host_interface *alt,
}
static int uas_use_uas_driver(struct usb_interface *intf,
- const struct usb_device_id *id)
+ const struct usb_device_id *id,
+ unsigned long *flags_ret)
{
struct usb_host_endpoint *eps[4] = { };
struct usb_device *udev = interface_to_usbdev(intf);
@@ -132,5 +133,8 @@ static int uas_use_uas_driver(struct usb_interface *intf,
return 0;
}
+ if (flags_ret)
+ *flags_ret = flags;
+
return 1;
}
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 6cdabdc..c6109c1 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -887,8 +887,9 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
struct Scsi_Host *shost = NULL;
struct uas_dev_info *devinfo;
struct usb_device *udev = interface_to_usbdev(intf);
+ unsigned long dev_flags;
- if (!uas_use_uas_driver(intf, id))
+ if (!uas_use_uas_driver(intf, id, &dev_flags))
return -ENODEV;
if (uas_switch_interface(udev, intf))
@@ -910,8 +911,7 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
devinfo->udev = udev;
devinfo->resetting = 0;
devinfo->shutdown = 0;
- devinfo->flags = id->driver_info;
- usb_stor_adjust_quirks(udev, &devinfo->flags);
+ devinfo->flags = dev_flags;
init_usb_anchor(&devinfo->cmd_urbs);
init_usb_anchor(&devinfo->sense_urbs);
init_usb_anchor(&devinfo->data_urbs);
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index d468d02..a550fac 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -1074,7 +1074,7 @@ static int storage_probe(struct usb_interface *intf,
/* If uas is enabled and this device can do uas then ignore it. */
#if IS_ENABLED(CONFIG_USB_UAS)
- if (uas_use_uas_driver(intf, id))
+ if (uas_use_uas_driver(intf, id, NULL))
return -ENXIO;
#endif
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 24/92] uas: Add US_FL_MAX_SECTORS_240 flag
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (22 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 23/92] uas: Allow uas_use_uas_driver to return usb-storage flags Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 25/92] uas: Set max_sectors_240 quirk for ASM1053 devices Kamal Mostafa
` (67 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <hdegoede@redhat.com>
commit ee136af4a064c2f61e2025873584d2c7ec93f4ae upstream.
The usb-storage driver sets max_sectors = 240 in its scsi-host template,
for uas we do not want to do that for all devices, but testing has shown
that some devices need it.
This commit adds a US_FL_MAX_SECTORS_240 flag for such devices, and
implements support for it in uas.c, while at it it also adds support
for US_FL_MAX_SECTORS_64 to uas.c.
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>
---
Documentation/kernel-parameters.txt | 2 ++
drivers/usb/storage/uas.c | 10 +++++++++-
drivers/usb/storage/usb.c | 6 +++++-
include/linux/usb_usual.h | 2 ++
4 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 176d4fe..c7e8f40 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -3717,6 +3717,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
READ_CAPACITY_16 command);
f = NO_REPORT_OPCODES (don't use report opcodes
command, uas only);
+ g = MAX_SECTORS_240 (don't transfer more than
+ 240 sectors at a time, uas only);
h = CAPACITY_HEURISTICS (decrease the
reported device capacity by one
sector if the number is odd);
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index c6109c1..6d3122a 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -759,7 +759,10 @@ static int uas_eh_bus_reset_handler(struct scsi_cmnd *cmnd)
static int uas_slave_alloc(struct scsi_device *sdev)
{
- sdev->hostdata = (void *)sdev->host->hostdata;
+ struct uas_dev_info *devinfo =
+ (struct uas_dev_info *)sdev->host->hostdata;
+
+ sdev->hostdata = devinfo;
/* USB has unusual DMA-alignment requirements: Although the
* starting address of each scatter-gather element doesn't matter,
@@ -778,6 +781,11 @@ static int uas_slave_alloc(struct scsi_device *sdev)
*/
blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1));
+ if (devinfo->flags & US_FL_MAX_SECTORS_64)
+ blk_queue_max_hw_sectors(sdev->request_queue, 64);
+ else if (devinfo->flags & US_FL_MAX_SECTORS_240)
+ blk_queue_max_hw_sectors(sdev->request_queue, 240);
+
return 0;
}
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index a550fac..9c5eb04 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -479,7 +479,8 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags)
US_FL_SINGLE_LUN | US_FL_NO_WP_DETECT |
US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16 |
US_FL_INITIAL_READ10 | US_FL_WRITE_CACHE |
- US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES);
+ US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES |
+ US_FL_MAX_SECTORS_240);
p = quirks;
while (*p) {
@@ -520,6 +521,9 @@ void usb_stor_adjust_quirks(struct usb_device *udev, unsigned long *fflags)
case 'f':
f |= US_FL_NO_REPORT_OPCODES;
break;
+ case 'g':
+ f |= US_FL_MAX_SECTORS_240;
+ break;
case 'h':
f |= US_FL_CAPACITY_HEURISTICS;
break;
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index a7f2604..7f5f78b 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -77,6 +77,8 @@
/* Cannot handle ATA_12 or ATA_16 CDBs */ \
US_FLAG(NO_REPORT_OPCODES, 0x04000000) \
/* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \
+ US_FLAG(MAX_SECTORS_240, 0x08000000) \
+ /* Sets max_sectors to 240 */ \
#define US_FLAG(name, value) US_FL_##name = value ,
enum { US_DO_ALL_FLAGS };
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 25/92] uas: Set max_sectors_240 quirk for ASM1053 devices
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (23 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 24/92] uas: Add US_FL_MAX_SECTORS_240 flag Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 26/92] usb: chipidea: otg: remove mutex unlock and lock while stop and start role Kamal Mostafa
` (66 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans de Goede, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <hdegoede@redhat.com>
commit 8e779c6c4a398763c21371fe40f649206041dc1e upstream.
Testing has shown that ASM1053 devices do not work properly with transfers
larger than 240 sectors, so set max_sectors to 240 on these.
Reported-by: Steve Bangert <sbangert@frontier.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Steve Bangert <sbangert@frontier.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/storage/uas-detect.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
index 63ae161..f58caa9 100644
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -74,7 +74,7 @@ static int uas_use_uas_driver(struct usb_interface *intf,
* this writing the following versions exist:
* ASM1051 - no uas support version
* ASM1051 - with broken (*) uas support
- * ASM1053 - with working uas support
+ * ASM1053 - with working uas support, but problems with large xfers
* ASM1153 - with working uas support
*
* Devices with these chips re-use a number of device-ids over the
@@ -104,6 +104,9 @@ static int uas_use_uas_driver(struct usb_interface *intf,
} else if (usb_ss_max_streams(&eps[1]->ss_ep_comp) == 32) {
/* Possibly an ASM1051, disable uas */
flags |= US_FL_IGNORE_UAS;
+ } else {
+ /* ASM1053, these have issues with large transfers */
+ flags |= US_FL_MAX_SECTORS_240;
}
}
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 26/92] usb: chipidea: otg: remove mutex unlock and lock while stop and start role
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (24 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 25/92] uas: Set max_sectors_240 quirk for ASM1053 devices Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 27/92] cdc-acm: prevent infinite loop when parsing CDC headers Kamal Mostafa
` (65 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Li Jun, Peter Chen, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Jun <jun.li@freescale.com>
commit a5a356cee89f86ff86cc3ce24136ca1f802c1bf1 upstream.
Wrongly release mutex lock during otg_statemachine may result in re-enter
otg_statemachine, which is not allowed, we should do next state transtition
after previous one completed.
Fixes: 826cfe751f3e ("usb: chipidea: add OTG fsm operation functions implementation")
Signed-off-by: Li Jun <jun.li@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/chipidea/otg_fsm.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
index 562e581..3770330 100644
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -537,7 +537,6 @@ static int ci_otg_start_host(struct otg_fsm *fsm, int on)
{
struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm);
- mutex_unlock(&fsm->lock);
if (on) {
ci_role_stop(ci);
ci_role_start(ci, CI_ROLE_HOST);
@@ -546,7 +545,6 @@ static int ci_otg_start_host(struct otg_fsm *fsm, int on)
hw_device_reset(ci);
ci_role_start(ci, CI_ROLE_GADGET);
}
- mutex_lock(&fsm->lock);
return 0;
}
@@ -554,12 +552,10 @@ static int ci_otg_start_gadget(struct otg_fsm *fsm, int on)
{
struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm);
- mutex_unlock(&fsm->lock);
if (on)
usb_gadget_vbus_connect(&ci->gadget);
else
usb_gadget_vbus_disconnect(&ci->gadget);
- mutex_lock(&fsm->lock);
return 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 27/92] cdc-acm: prevent infinite loop when parsing CDC headers.
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (25 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 26/92] usb: chipidea: otg: remove mutex unlock and lock while stop and start role Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 28/92] serial: xilinx: Use platform_get_irq to get irq description structure Kamal Mostafa
` (64 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Phil Turnbull, Quentin Casasnovas, Sergei Shtylyov,
Oliver Neukum, Adam Lee, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Casasnovas <quentin.casasnovas@oracle.com>
commit 0d3bba0287d4e284c3ec7d3397e81eec920d5e7e upstream.
Phil and I found out a problem with commit:
7e860a6e7aa6 ("cdc-acm: add sanity checks")
It added some sanity checks to ignore potential garbage in CDC headers but
also introduced a potential infinite loop. This can happen at the first
loop iteration (elength = 0 in that case) if the description isn't a
DT_CS_INTERFACE or later if 'buffer[0]' is zero.
It should also be noted that the wrong length was being added to 'buffer'
in case 'buffer[1]' was not a DT_CS_INTERFACE descriptor, since elength was
assigned after that check in the loop.
A specially crafted USB device could be used to trigger this infinite loop.
Fixes: 7e860a6e7aa6 ("cdc-acm: add sanity checks")
Signed-off-by: Phil Turnbull <phil.turnbull@oracle.com>
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
CC: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
CC: Oliver Neukum <oneukum@suse.de>
CC: Adam Lee <adam8157@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/class/cdc-acm.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index a417b73..054fc28 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1133,11 +1133,16 @@ static int acm_probe(struct usb_interface *intf,
}
while (buflen > 0) {
+ elength = buffer[0];
+ if (!elength) {
+ dev_err(&intf->dev, "skipping garbage byte\n");
+ elength = 1;
+ goto next_desc;
+ }
if (buffer[1] != USB_DT_CS_INTERFACE) {
dev_err(&intf->dev, "skipping garbage\n");
goto next_desc;
}
- elength = buffer[0];
switch (buffer[2]) {
case USB_CDC_UNION_TYPE: /* we've found it */
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 28/92] serial: xilinx: Use platform_get_irq to get irq description structure
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (26 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 27/92] cdc-acm: prevent infinite loop when parsing CDC headers Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 29/92] serial: of-serial: Remove device_type = "serial" registration Kamal Mostafa
` (63 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michal Simek, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Simek <michal.simek@xilinx.com>
commit 5c90c07b98c02198d9777a7c4f3047b0a94bf7ed upstream.
For systems with CONFIG_SERIAL_OF_PLATFORM=y and device_type =
"serial"; property in DT of_serial.c driver maps and unmaps IRQ (because
driver probe fails). Then a driver is called but irq mapping is not
created that's why driver is failing again in again on request_irq().
Based on this use platform_get_irq() instead of platform_get_resource()
which is doing irq_desc allocation and driver itself can request IRQ.
Fix both xilinx serial drivers in the tree.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/serial/uartlite.c | 11 ++++++-----
drivers/tty/serial/xilinx_uartps.c | 12 ++++++------
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 189f52e..a0099a7 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -632,7 +632,8 @@ MODULE_DEVICE_TABLE(of, ulite_of_match);
static int ulite_probe(struct platform_device *pdev)
{
- struct resource *res, *res2;
+ struct resource *res;
+ int irq;
int id = pdev->id;
#ifdef CONFIG_OF
const __be32 *prop;
@@ -646,11 +647,11 @@ static int ulite_probe(struct platform_device *pdev)
if (!res)
return -ENODEV;
- res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (!res2)
- return -ENODEV;
+ irq = platform_get_irq(pdev, 0);
+ if (irq <= 0)
+ return -ENXIO;
- return ulite_assign(&pdev->dev, id, res->start, res2->start);
+ return ulite_assign(&pdev->dev, id, res->start, irq);
}
static int ulite_remove(struct platform_device *pdev)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 542bab3..4716721 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1323,9 +1323,9 @@ static SIMPLE_DEV_PM_OPS(cdns_uart_dev_pm_ops, cdns_uart_suspend,
*/
static int cdns_uart_probe(struct platform_device *pdev)
{
- int rc, id;
+ int rc, id, irq;
struct uart_port *port;
- struct resource *res, *res2;
+ struct resource *res;
struct cdns_uart *cdns_uart_data;
cdns_uart_data = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_data),
@@ -1372,9 +1372,9 @@ static int cdns_uart_probe(struct platform_device *pdev)
goto err_out_clk_disable;
}
- res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (!res2) {
- rc = -ENODEV;
+ irq = platform_get_irq(pdev, 0);
+ if (irq <= 0) {
+ rc = -ENXIO;
goto err_out_clk_disable;
}
@@ -1403,7 +1403,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
* and triggers invocation of the config_port() entry point.
*/
port->mapbase = res->start;
- port->irq = res2->start;
+ port->irq = irq;
port->dev = &pdev->dev;
port->uartclk = clk_get_rate(cdns_uart_data->uartclk);
port->private_data = cdns_uart_data;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 29/92] serial: of-serial: Remove device_type = "serial" registration
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (27 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 28/92] serial: xilinx: Use platform_get_irq to get irq description structure Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 30/92] tty/serial: at91: maxburst was missing for dma transfers Kamal Mostafa
` (62 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Michal Simek, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Simek <michal.simek@xilinx.com>
commit 6befa9d883385c580369a2cc9e53fbf329771f6d upstream.
Do not probe all serial drivers by of_serial.c which are using
device_type = "serial"; property. Only drivers which have valid
compatible strings listed in the driver should be probed.
When PORT_UNKNOWN is setup probe will fail anyway.
Arnd quotation about driver historical background:
"when I wrote that driver initially, the idea was that it would
get used as a stub to hook up all other serial drivers but after
that, the common code learned to create platform devices from DT"
This patch fix the problem with on the system with xilinx_uartps and
16550a where of_serial failed to register for xilinx_uartps and because
of irq_dispose_mapping() removed irq_desc. Then when xilinx_uartps was asking
for irq with request_irq() EINVAL is returned.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/serial/of_serial.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 64f1bab..e79d884 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -335,7 +335,6 @@ static struct of_device_id of_platform_serial_table[] = {
{ .compatible = "ibm,qpace-nwp-serial",
.data = (void *)PORT_NWPSERIAL, },
#endif
- { .type = "serial", .data = (void *)PORT_UNKNOWN, },
{ /* end of list */ },
};
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 30/92] tty/serial: at91: maxburst was missing for dma transfers
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (28 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 29/92] serial: of-serial: Remove device_type = "serial" registration Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 31/92] ALSA: emux: Fix mutex deadlock in OSS emulation Kamal Mostafa
` (61 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ludovic Desroches, Greg Kroah-Hartman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ludovic Desroches <ludovic.desroches@atmel.com>
commit a8d4e01637902311c5643b69a5c80e2805f04054 upstream.
Maxburst was not set when doing the dma slave configuration. This value
is checked by the recently introduced xdmac. It causes an error when
doing the slave configuration and so prevents from using dma.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/serial/atmel_serial.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 92a8b26..95f8f64 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -856,6 +856,7 @@ static int atmel_prepare_tx_dma(struct uart_port *port)
config.direction = DMA_MEM_TO_DEV;
config.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
config.dst_addr = port->mapbase + ATMEL_US_THR;
+ config.dst_maxburst = 1;
ret = dmaengine_slave_config(atmel_port->chan_tx,
&config);
@@ -1035,6 +1036,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
config.direction = DMA_DEV_TO_MEM;
config.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
config.src_addr = port->mapbase + ATMEL_US_RHR;
+ config.src_maxburst = 1;
ret = dmaengine_slave_config(atmel_port->chan_rx,
&config);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 31/92] ALSA: emux: Fix mutex deadlock in OSS emulation
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (29 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 30/92] tty/serial: at91: maxburst was missing for dma transfers Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 32/92] ACPI / SBS: Enable battery manager when present Kamal Mostafa
` (60 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 1c94e65c668f44d2c69ae7e7fc268ab3268fba3e upstream.
The OSS emulation in synth-emux helper has a potential AB/BA deadlock
at the simultaneous closing and opening:
close ->
snd_seq_release() ->
sne_seq_free_client() ->
snd_seq_delete_all_ports(): takes client->ports_mutex ->
port_delete() ->
snd_emux_unuse(): takes emux->register_mutex
open ->
snd_seq_oss_open() ->
snd_emux_open_seq_oss(): takes emux->register_mutex ->
snd_seq_event_port_attach() ->
snd_seq_create_port(): takes client->ports_mutex
This patch addresses the deadlock by reducing the rance taking
emux->register_mutex in snd_emux_open_seq_oss(). The lock is needed
for the refcount handling, so move it locally. The calls in
emux_seq.c are already with the mutex, thus they are replaced with the
version without mutex lock/unlock.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/synth/emux/emux_oss.c | 11 +----------
sound/synth/emux/emux_seq.c | 27 +++++++++++++++++++++------
2 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c
index 319754c..daf61ab 100644
--- a/sound/synth/emux/emux_oss.c
+++ b/sound/synth/emux/emux_oss.c
@@ -118,12 +118,8 @@ snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
if (snd_BUG_ON(!arg || !emu))
return -ENXIO;
- mutex_lock(&emu->register_mutex);
-
- if (!snd_emux_inc_count(emu)) {
- mutex_unlock(&emu->register_mutex);
+ if (!snd_emux_inc_count(emu))
return -EFAULT;
- }
memset(&callback, 0, sizeof(callback));
callback.owner = THIS_MODULE;
@@ -135,7 +131,6 @@ snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
if (p == NULL) {
snd_printk(KERN_ERR "can't create port\n");
snd_emux_dec_count(emu);
- mutex_unlock(&emu->register_mutex);
return -ENOMEM;
}
@@ -148,8 +143,6 @@ snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
reset_port_mode(p, arg->seq_mode);
snd_emux_reset_port(p);
-
- mutex_unlock(&emu->register_mutex);
return 0;
}
@@ -195,13 +188,11 @@ snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg)
if (snd_BUG_ON(!emu))
return -ENXIO;
- mutex_lock(&emu->register_mutex);
snd_emux_sounds_off_all(p);
snd_soundfont_close_check(emu->sflist, SF_CLIENT_NO(p->chset.port));
snd_seq_event_port_detach(p->chset.client, p->chset.port);
snd_emux_dec_count(emu);
- mutex_unlock(&emu->register_mutex);
return 0;
}
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index 188fda0e..a020920 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -267,8 +267,8 @@ snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private_data,
/*
* increment usage count
*/
-int
-snd_emux_inc_count(struct snd_emux *emu)
+static int
+__snd_emux_inc_count(struct snd_emux *emu)
{
emu->used++;
if (!try_module_get(emu->ops.owner))
@@ -282,12 +282,21 @@ snd_emux_inc_count(struct snd_emux *emu)
return 1;
}
+int snd_emux_inc_count(struct snd_emux *emu)
+{
+ int ret;
+
+ mutex_lock(&emu->register_mutex);
+ ret = __snd_emux_inc_count(emu);
+ mutex_unlock(&emu->register_mutex);
+ return ret;
+}
/*
* decrease usage count
*/
-void
-snd_emux_dec_count(struct snd_emux *emu)
+static void
+__snd_emux_dec_count(struct snd_emux *emu)
{
module_put(emu->card->module);
emu->used--;
@@ -296,6 +305,12 @@ snd_emux_dec_count(struct snd_emux *emu)
module_put(emu->ops.owner);
}
+void snd_emux_dec_count(struct snd_emux *emu)
+{
+ mutex_lock(&emu->register_mutex);
+ __snd_emux_dec_count(emu);
+ mutex_unlock(&emu->register_mutex);
+}
/*
* Routine that is called upon a first use of a particular port
@@ -315,7 +330,7 @@ snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info)
mutex_lock(&emu->register_mutex);
snd_emux_init_port(p);
- snd_emux_inc_count(emu);
+ __snd_emux_inc_count(emu);
mutex_unlock(&emu->register_mutex);
return 0;
}
@@ -338,7 +353,7 @@ snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info)
mutex_lock(&emu->register_mutex);
snd_emux_sounds_off_all(p);
- snd_emux_dec_count(emu);
+ __snd_emux_dec_count(emu);
mutex_unlock(&emu->register_mutex);
return 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 32/92] ACPI / SBS: Enable battery manager when present
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (30 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 31/92] ALSA: emux: Fix mutex deadlock in OSS emulation Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 33/92] ALSA: emu10k1: Emu10k2 32 bit DMA mode Kamal Mostafa
` (59 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chris Bainbridge, Rafael J. Wysocki, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Bainbridge <chris.bainbridge@gmail.com>
commit 61f8ff693923e4b19748b0e8287b99778f2661c7 upstream.
Commit 9faf6136ff46 (ACPI / SBS: Disable smart battery manager on
Apple) introduced a regression disabling the SBS battery manager.
The battery manager should be marked as present when
acpi_manager_get_info() returns 0.
Fixes: 9faf6136ff46 (ACPI / SBS: Disable smart battery manager on Apple)
Signed-off-by: Chris Bainbridge <chris.bainbridge@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/acpi/sbs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index a7a3edd..f23179e 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -670,7 +670,7 @@ static int acpi_sbs_add(struct acpi_device *device)
if (!sbs_manager_broken) {
result = acpi_manager_get_info(sbs);
if (!result) {
- sbs->manager_present = 0;
+ sbs->manager_present = 1;
for (id = 0; id < MAX_SBS_BAT; ++id)
if ((sbs->batteries_supported & (1 << id)))
acpi_battery_add(sbs, id);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 33/92] ALSA: emu10k1: Emu10k2 32 bit DMA mode
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (31 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 32/92] ACPI / SBS: Enable battery manager when present Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 34/92] ASoC: rt5677: fixed wrong DMIC ref clock Kamal Mostafa
` (58 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Peter Zubaj, Takashi Iwai, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zubaj <pzubaj@marticonet.sk>
commit 7241ea558c6715501e777396b5fc312c372e11d9 upstream.
Looks like audigy emu10k2 (probably emu10k1 - sb live too) support two
modes for DMA. Second mode is useful for 64 bit os with more then 2 GB
of ram (fixes problems with big soundfont loading)
1) 32MB from 2 GB address space using 8192 pages (used now as default)
2) 16MB from 4 GB address space using 4096 pages
Mode is set using HCFG_EXPANDED_MEM flag in HCFG register.
Also format of emu10k2 page table is then different.
Signed-off-by: Peter Zubaj <pzubaj@marticonet.sk>
Tested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
include/sound/emu10k1.h | 14 +++++++++-----
sound/pci/emu10k1/emu10k1_callback.c | 4 ++--
sound/pci/emu10k1/emu10k1_main.c | 17 ++++++++++++-----
sound/pci/emu10k1/emupcm.c | 2 +-
sound/pci/emu10k1/memory.c | 11 ++++++-----
5 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index c46908c..8af2fff 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -41,7 +41,8 @@
#define EMUPAGESIZE 4096
#define MAXREQVOICES 8
-#define MAXPAGES 8192
+#define MAXPAGES0 4096 /* 32 bit mode */
+#define MAXPAGES1 8192 /* 31 bit mode */
#define RESERVED 0
#define NUM_MIDI 16
#define NUM_G 64 /* use all channels */
@@ -50,8 +51,7 @@
/* FIXME? - according to the OSS driver the EMU10K1 needs a 29 bit DMA mask */
#define EMU10K1_DMA_MASK 0x7fffffffUL /* 31bit */
-#define AUDIGY_DMA_MASK 0x7fffffffUL /* 31bit FIXME - 32 should work? */
- /* See ALSA bug #1276 - rlrevell */
+#define AUDIGY_DMA_MASK 0xffffffffUL /* 32bit mode */
#define TMEMSIZE 256*1024
#define TMEMSIZEREG 4
@@ -466,8 +466,11 @@
#define MAPB 0x0d /* Cache map B */
-#define MAP_PTE_MASK 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */
-#define MAP_PTI_MASK 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */
+#define MAP_PTE_MASK0 0xfffff000 /* The 20 MSBs of the PTE indexed by the PTI */
+#define MAP_PTI_MASK0 0x00000fff /* The 12 bit index to one of the 4096 PTE dwords */
+
+#define MAP_PTE_MASK1 0xffffe000 /* The 19 MSBs of the PTE indexed by the PTI */
+#define MAP_PTI_MASK1 0x00001fff /* The 13 bit index to one of the 8192 PTE dwords */
/* 0x0e, 0x0f: Not used */
@@ -1704,6 +1707,7 @@ struct snd_emu10k1 {
unsigned short model; /* subsystem id */
unsigned int card_type; /* EMU10K1_CARD_* */
unsigned int ecard_ctrl; /* ecard control bits */
+ unsigned int address_mode; /* address mode */
unsigned long dma_mask; /* PCI DMA mask */
unsigned int delay_pcm_irq; /* in samples */
int max_cache_pages; /* max memory size / PAGE_SIZE */
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c
index 874cd76..d2c7ea3 100644
--- a/sound/pci/emu10k1/emu10k1_callback.c
+++ b/sound/pci/emu10k1/emu10k1_callback.c
@@ -415,7 +415,7 @@ start_voice(struct snd_emux_voice *vp)
snd_emu10k1_ptr_write(hw, Z2, ch, 0);
/* invalidate maps */
- temp = (hw->silent_page.addr << 1) | MAP_PTI_MASK;
+ temp = (hw->silent_page.addr << hw->address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0);
snd_emu10k1_ptr_write(hw, MAPA, ch, temp);
snd_emu10k1_ptr_write(hw, MAPB, ch, temp);
#if 0
@@ -436,7 +436,7 @@ start_voice(struct snd_emux_voice *vp)
snd_emu10k1_ptr_write(hw, CDF, ch, sample);
/* invalidate maps */
- temp = ((unsigned int)hw->silent_page.addr << 1) | MAP_PTI_MASK;
+ temp = ((unsigned int)hw->silent_page.addr << hw_address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0);
snd_emu10k1_ptr_write(hw, MAPA, ch, temp);
snd_emu10k1_ptr_write(hw, MAPB, ch, temp);
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index ddaba4d..df9f5c7 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -282,7 +282,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
snd_emu10k1_ptr_write(emu, TCB, 0, 0); /* taken from original driver */
snd_emu10k1_ptr_write(emu, TCBS, 0, 4); /* taken from original driver */
- silent_page = (emu->silent_page.addr << 1) | MAP_PTI_MASK;
+ silent_page = (emu->silent_page.addr << emu->address_mode) | (emu->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0);
for (ch = 0; ch < NUM_G; ch++) {
snd_emu10k1_ptr_write(emu, MAPA, ch, silent_page);
snd_emu10k1_ptr_write(emu, MAPB, ch, silent_page);
@@ -348,6 +348,11 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
outl(reg | A_IOCFG_GPOUT0, emu->port + A_IOCFG);
}
+ if (emu->address_mode == 0) {
+ /* use 16M in 4G */
+ outl(inl(emu->port + HCFG) | HCFG_EXPANDED_MEM, emu->port + HCFG);
+ }
+
return 0;
}
@@ -1877,8 +1882,10 @@ int snd_emu10k1_create(struct snd_card *card,
is_audigy = emu->audigy = c->emu10k2_chip;
+ /* set addressing mode */
+ emu->address_mode = is_audigy ? 0 : 1;
/* set the DMA transfer mask */
- emu->dma_mask = is_audigy ? AUDIGY_DMA_MASK : EMU10K1_DMA_MASK;
+ emu->dma_mask = emu->address_mode ? EMU10K1_DMA_MASK : AUDIGY_DMA_MASK;
if (pci_set_dma_mask(pci, emu->dma_mask) < 0 ||
pci_set_consistent_dma_mask(pci, emu->dma_mask) < 0) {
dev_err(card->dev,
@@ -1903,7 +1910,7 @@ int snd_emu10k1_create(struct snd_card *card,
emu->max_cache_pages = max_cache_bytes >> PAGE_SHIFT;
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
- 32 * 1024, &emu->ptb_pages) < 0) {
+ (emu->address_mode ? 32 : 16) * 1024, &emu->ptb_pages) < 0) {
err = -ENOMEM;
goto error;
}
@@ -2002,8 +2009,8 @@ int snd_emu10k1_create(struct snd_card *card,
/* Clear silent pages and set up pointers */
memset(emu->silent_page.area, 0, PAGE_SIZE);
- silent_page = emu->silent_page.addr << 1;
- for (idx = 0; idx < MAXPAGES; idx++)
+ silent_page = emu->silent_page.addr << emu->address_mode;
+ for (idx = 0; idx < (emu->address_mode ? MAXPAGES1 : MAXPAGES0); idx++)
((u32 *)emu->ptb_pages.area)[idx] = cpu_to_le32(silent_page | idx);
/* set up voice indices */
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index f82481b..36f0b86 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -380,7 +380,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
snd_emu10k1_ptr_write(emu, Z1, voice, 0);
snd_emu10k1_ptr_write(emu, Z2, voice, 0);
/* invalidate maps */
- silent_page = ((unsigned int)emu->silent_page.addr << 1) | MAP_PTI_MASK;
+ silent_page = ((unsigned int)emu->silent_page.addr << emu->address_mode) | (emu->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0);
snd_emu10k1_ptr_write(emu, MAPA, voice, silent_page);
snd_emu10k1_ptr_write(emu, MAPB, voice, silent_page);
/* modulation envelope */
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index c68e6dd..4f1f69b 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -34,10 +34,11 @@
* aligned pages in others
*/
#define __set_ptb_entry(emu,page,addr) \
- (((u32 *)(emu)->ptb_pages.area)[page] = cpu_to_le32(((addr) << 1) | (page)))
+ (((u32 *)(emu)->ptb_pages.area)[page] = cpu_to_le32(((addr) << (emu->address_mode)) | (page)))
#define UNIT_PAGES (PAGE_SIZE / EMUPAGESIZE)
-#define MAX_ALIGN_PAGES (MAXPAGES / UNIT_PAGES)
+#define MAX_ALIGN_PAGES0 (MAXPAGES0 / UNIT_PAGES)
+#define MAX_ALIGN_PAGES1 (MAXPAGES1 / UNIT_PAGES)
/* get aligned page from offset address */
#define get_aligned_page(offset) ((offset) >> PAGE_SHIFT)
/* get offset address from aligned page */
@@ -124,7 +125,7 @@ static int search_empty_map_area(struct snd_emu10k1 *emu, int npages, struct lis
}
page = blk->mapped_page + blk->pages;
}
- size = MAX_ALIGN_PAGES - page;
+ size = (emu->address_mode ? MAX_ALIGN_PAGES1 : MAX_ALIGN_PAGES0) - page;
if (size >= max_size) {
*nextp = pos;
return page;
@@ -181,7 +182,7 @@ static int unmap_memblk(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk)
q = get_emu10k1_memblk(p, mapped_link);
end_page = q->mapped_page;
} else
- end_page = MAX_ALIGN_PAGES;
+ end_page = (emu->address_mode ? MAX_ALIGN_PAGES1 : MAX_ALIGN_PAGES0);
/* remove links */
list_del(&blk->mapped_link);
@@ -307,7 +308,7 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
if (snd_BUG_ON(!emu))
return NULL;
if (snd_BUG_ON(runtime->dma_bytes <= 0 ||
- runtime->dma_bytes >= MAXPAGES * EMUPAGESIZE))
+ runtime->dma_bytes >= (emu->address_mode ? MAXPAGES1 : MAXPAGES0) * EMUPAGESIZE))
return NULL;
hdr = emu->memhdr;
if (snd_BUG_ON(!hdr))
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 34/92] ASoC: rt5677: fixed wrong DMIC ref clock
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (32 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 33/92] ALSA: emu10k1: Emu10k2 32 bit DMA mode Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 35/92] rbd: end I/O the entire obj_request on error Kamal Mostafa
` (57 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Bard Liao, Mark Brown, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Bard Liao <bardliao@realtek.com>
commit 60a8d62b8497c23eb3d48149af7e55dac2dd83a2 upstream.
DMIC clock source is not from codec system clock directly. it is
generated from the division of system clock. And it should be 256 *
sample rate of AIF1.
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
sound/soc/codecs/rt5677.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 9ce6b65..1038d2d 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -904,7 +904,7 @@ static int set_dmic_clk(struct snd_soc_dapm_widget *w,
{
struct snd_soc_codec *codec = w->codec;
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
- int idx = rl6231_calc_dmic_clk(rt5677->sysclk);
+ int idx = rl6231_calc_dmic_clk(rt5677->lrck[RT5677_AIF1] << 8);
if (idx < 0)
dev_err(codec->dev, "Failed to set DMIC clock\n");
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 35/92] rbd: end I/O the entire obj_request on error
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (33 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 34/92] ASoC: rt5677: fixed wrong DMIC ref clock Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 36/92] ext4: fix data corruption caused by unwritten and delayed extents Kamal Mostafa
` (56 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Alex Elder, Ilya Dryomov, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <idryomov@gmail.com>
commit 082a75dad84d79d1c15ea9e50f31cb4bb4fa7fd6 upstream.
When we end I/O struct request with error, we need to pass
obj_request->length as @nr_bytes so that the entire obj_request worth
of bytes is completed. Otherwise block layer ends up confused and we
trip on
rbd_assert(more ^ (which == img_request->obj_request_count));
in rbd_img_obj_callback() due to more being true no matter what. We
already do it in most cases but we are missing some, in particular
those where we don't even get a chance to submit any obj_requests, due
to an early -ENOMEM for example.
A number of obj_request->xferred assignments seem to be redundant but
I haven't touched any of obj_request->xferred stuff to keep this small
and isolated.
Cc: Alex Elder <elder@linaro.org>
Reported-by: Shawn Edwards <lesser.evil@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/block/rbd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 8a86b62..733e621 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2261,6 +2261,11 @@ static bool rbd_img_obj_end_request(struct rbd_obj_request *obj_request)
result, xferred);
if (!img_request->result)
img_request->result = result;
+ /*
+ * Need to end I/O on the entire obj_request worth of
+ * bytes in case of error.
+ */
+ xferred = obj_request->length;
}
/* Image object requests don't own their page array */
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 36/92] ext4: fix data corruption caused by unwritten and delayed extents
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (34 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 35/92] rbd: end I/O the entire obj_request on error Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 37/92] ext4: move check under lock scope to close a race Kamal Mostafa
` (55 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lukas Czerner, Theodore Ts'o, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Czerner <lczerner@redhat.com>
commit d2dc317d564a46dfc683978a2e5a4f91434e9711 upstream.
Currently it is possible to lose whole file system block worth of data
when we hit the specific interaction with unwritten and delayed extents
in status extent tree.
The problem is that when we insert delayed extent into extent status
tree the only way to get rid of it is when we write out delayed buffer.
However there is a limitation in the extent status tree implementation
so that when inserting unwritten extent should there be even a single
delayed block the whole unwritten extent would be marked as delayed.
At this point, there is no way to get rid of the delayed extents,
because there are no delayed buffers to write out. So when a we write
into said unwritten extent we will convert it to written, but it still
remains delayed.
When we try to write into that block later ext4_da_map_blocks() will set
the buffer new and delayed and map it to invalid block which causes
the rest of the block to be zeroed loosing already written data.
For now we can fix this by simply not allowing to set delayed status on
written extent in the extent status tree. Also add WARN_ON() to make
sure that we notice if this happens in the future.
This problem can be easily reproduced by running the following xfs_io.
xfs_io -f -c "pwrite -S 0xaa 4096 2048" \
-c "falloc 0 131072" \
-c "pwrite -S 0xbb 65536 2048" \
-c "fsync" /mnt/test/fff
echo 3 > /proc/sys/vm/drop_caches
xfs_io -c "pwrite -S 0xdd 67584 2048" /mnt/test/fff
This can be theoretically also reproduced by at random by running fsx,
but it's not very reliable, though on machines with bigger page size
(like ppc) this can be seen more often (especially xfstest generic/127)
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/extents_status.c | 8 ++++++++
fs/ext4/inode.c | 2 ++
2 files changed, 10 insertions(+)
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index e04d457..9a01213 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -705,6 +705,14 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
BUG_ON(end < lblk);
+ if ((status & EXTENT_STATUS_DELAYED) &&
+ (status & EXTENT_STATUS_WRITTEN)) {
+ ext4_warning(inode->i_sb, "Inserting extent [%u/%u] as "
+ " delayed and written which can potentially "
+ " cause data loss.\n", lblk, len);
+ WARN_ON(1);
+ }
+
newes.es_lblk = lblk;
newes.es_len = len;
ext4_es_store_pblock_status(&newes, pblk, status);
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 5653fa4..9743a38 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -534,6 +534,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
status = map->m_flags & EXT4_MAP_UNWRITTEN ?
EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN;
if (!(flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE) &&
+ !(status & EXTENT_STATUS_WRITTEN) &&
ext4_find_delalloc_range(inode, map->m_lblk,
map->m_lblk + map->m_len - 1))
status |= EXTENT_STATUS_DELAYED;
@@ -638,6 +639,7 @@ found:
status = map->m_flags & EXT4_MAP_UNWRITTEN ?
EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN;
if (!(flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE) &&
+ !(status & EXTENT_STATUS_WRITTEN) &&
ext4_find_delalloc_range(inode, map->m_lblk,
map->m_lblk + map->m_len - 1))
status |= EXTENT_STATUS_DELAYED;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 37/92] ext4: move check under lock scope to close a race.
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (35 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 36/92] ext4: fix data corruption caused by unwritten and delayed extents Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 38/92] powerpc/pseries: Correct cpu affinity for dlpar added cpus Kamal Mostafa
` (54 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Davide Italiano, Theodore Ts'o, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Davide Italiano <dccitaliano@gmail.com>
commit 280227a75b56ab5d35854f3a77ef74a7ad56a203 upstream.
fallocate() checks that the file is extent-based and returns
EOPNOTSUPP in case is not. Other tasks can convert from and to
indirect and extent so it's safe to check only after grabbing
the inode mutex.
Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/ext4/extents.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index aa52242..30dee3c 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4941,13 +4941,6 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
if (ret)
return ret;
- /*
- * currently supporting (pre)allocate mode for extent-based
- * files _only_
- */
- if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
- return -EOPNOTSUPP;
-
if (mode & FALLOC_FL_COLLAPSE_RANGE)
return ext4_collapse_range(inode, offset, len);
@@ -4969,6 +4962,14 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
mutex_lock(&inode->i_mutex);
+ /*
+ * We only support preallocation for extent-based files only
+ */
+ if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
+ ret = -EOPNOTSUPP;
+ goto out;
+ }
+
if (!(mode & FALLOC_FL_KEEP_SIZE) &&
offset + len > i_size_read(inode)) {
new_size = offset + len;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 38/92] powerpc/pseries: Correct cpu affinity for dlpar added cpus
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (36 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 37/92] ext4: move check under lock scope to close a race Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 39/92] powerpc/powernv: Restore non-volatile CRs after nap Kamal Mostafa
` (53 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Nathan Fontenot, Michael Ellerman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
commit f32393c943e297b8ae180c8f83d81a156c7d0412 upstream.
The incorrect ordering of operations during cpu dlpar add results in invalid
affinity for the cpu being added. The ibm,associativity property in the
device tree is populated with all zeroes for the added cpu which results in
invalid affinity mappings and all cpus appear to belong to node 0.
This occurs because rtas configure-connector is called prior to making the
rtas set-indicator calls. Phyp does not assign affinity information
for a cpu until the rtas set-indicator calls are made to set the isolation
and allocation state.
Correct the order of operations to make the rtas set-indicator
calls (done in dlpar_acquire_drc) before calling rtas configure-connector.
Fixes: 1a8061c46c46 ("powerpc/pseries: Add kernel based CPU DLPAR handling")
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/platforms/pseries/dlpar.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index c22bb1b..0991578 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -410,6 +410,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
if (rc)
return -EINVAL;
+ rc = dlpar_acquire_drc(drc_index);
+ if (rc)
+ return -EINVAL;
+
parent = of_find_node_by_path("/cpus");
if (!parent)
return -ENODEV;
@@ -420,12 +424,6 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
of_node_put(parent);
- rc = dlpar_acquire_drc(drc_index);
- if (rc) {
- dlpar_free_cc_nodes(dn);
- return -EINVAL;
- }
-
rc = dlpar_attach_node(dn);
if (rc) {
dlpar_release_drc(drc_index);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 39/92] powerpc/powernv: Restore non-volatile CRs after nap
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (37 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 38/92] powerpc/pseries: Correct cpu affinity for dlpar added cpus Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 40/92] efivarfs: Ensure VariableName is NUL-terminated Kamal Mostafa
` (52 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Sam Bobroff, Michael Ellerman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Sam Bobroff <sam.bobroff@au1.ibm.com>
commit 0aab3747091db309b8a484cfd382a41644552aa3 upstream.
Patches 7cba160ad "powernv/cpuidle: Redesign idle states management"
and 77b54e9f2 "powernv/powerpc: Add winkle support for offline cpus"
use non-volatile condition registers (cr2, cr3 and cr4) early in the system
reset interrupt handler (system_reset_pSeries()) before it has been determined
if state loss has occurred. If state loss has not occurred, control returns via
the power7_wakeup_noloss() path which does not restore those condition
registers, leaving them corrupted.
Fix this by restoring the condition registers in the power7_wakeup_noloss()
case.
This is apparent when running a KVM guest on hardware that does not
support winkle or sleep and the guest makes use of secondary threads. In
practice this means Power7 machines, though some early unreleased Power8
machines may also be susceptible.
The secondary CPUs are taken off line before the guest is started and
they call pnv_smp_cpu_kill_self(). This checks support for sleep
states (in this case there is no support) and power7_nap() is called.
When the CPU is woken, power7_nap() returns and because the CPU is
still off line, the main while loop executes again. The sleep states
support test is executed again, but because the tested values cannot
have changed, the compiler has optimized the test away and instead we
rely on the result of the first test, which has been left in cr3
and/or cr4. With the result overwritten, the wrong branch is taken and
power7_winkle() is called on a CPU that does not support it, leading
to it stalling.
Fixes: 7cba160ad789 ("powernv/cpuidle: Redesign idle states management")
Fixes: 77b54e9f213f ("powernv/powerpc: Add winkle support for offline cpus")
[mpe: Massage change log a bit more]
Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/powerpc/kernel/idle_power7.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S
index 05adc8b..401d8d0 100644
--- a/arch/powerpc/kernel/idle_power7.S
+++ b/arch/powerpc/kernel/idle_power7.S
@@ -500,9 +500,11 @@ BEGIN_FTR_SECTION
CHECK_HMI_INTERRUPT
END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
ld r1,PACAR1(r13)
+ ld r6,_CCR(r1)
ld r4,_MSR(r1)
ld r5,_NIP(r1)
addi r1,r1,INT_FRAME_SIZE
+ mtcr r6
mtspr SPRN_SRR1,r4
mtspr SPRN_SRR0,r5
rfid
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 40/92] efivarfs: Ensure VariableName is NUL-terminated
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (38 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 39/92] powerpc/powernv: Restore non-volatile CRs after nap Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 41/92] x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr Kamal Mostafa
` (51 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ross Lagerwall, Jeremy Kerr, Matt Fleming, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ross Lagerwall <ross.lagerwall@citrix.com>
commit c57dcb566d3d866a302a1da2e06344bec31d5bcd upstream.
Some buggy firmware implementations update VariableNameSize on success
such that it does not include the final NUL character which results in
garbage in the efivarfs name entries. Use kzalloc on the efivar_entry
(as is done in efivars.c) to ensure that the name is always
NUL-terminated.
The buggy firmware is:
BIOS Information
Vendor: Intel Corp.
Version: S1200RP.86B.02.02.0005.102320140911
Release Date: 10/23/2014
BIOS Revision: 4.6
System Information
Manufacturer: Intel Corporation
Product Name: S1200RP_SE
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Acked-by: Matthew Garrett <mjg59@coreos.com>
Cc: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/efivarfs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 6dad117..7b9efb9 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -121,7 +121,7 @@ static int efivarfs_callback(efi_char16_t *name16, efi_guid_t vendor,
int len, i;
int err = -ENOMEM;
- entry = kmalloc(sizeof(*entry), GFP_KERNEL);
+ entry = kzalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
return err;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 41/92] x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (39 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 40/92] efivarfs: Ensure VariableName is NUL-terminated Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 42/92] blk-mq: fix race between timeout and CPU hotplug Kamal Mostafa
` (50 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Roy Franz, Matt Fleming, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Roy Franz <roy.franz@linaro.org>
commit 98b228f55014870092c15d7d168fecac69f2f12a upstream.
Until now, the EFI stub was only setting the 32 bit cmd_line_ptr in
the setup_header structure, so on 64 bit platforms this could be truncated.
This patch adds setting the upper bits of the buffer address in
ext_cmd_line_ptr. This case was likely never hit, as the allocation
for this buffer is done at the lowest available address. Only
x86_64 kernels have this problem, as the 1-1 mapping mandated
by EFI ensures that all memory is 32 bit addressable on 32 bit
platforms. The EFI stub does not support mixed mode, so the
32 bit kernel on 64 bit firmware case does not need to be handled.
Signed-off-by: Roy Franz <roy.franz@linaro.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/boot/compressed/eboot.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 92b9a5f..5999980 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -1110,6 +1110,8 @@ struct boot_params *make_boot_params(struct efi_config *c)
if (!cmdline_ptr)
goto fail;
hdr->cmd_line_ptr = (unsigned long)cmdline_ptr;
+ /* Fill in upper bits of command line address, NOP on 32 bit */
+ boot_params->ext_cmd_line_ptr = (u64)(unsigned long)cmdline_ptr >> 32;
hdr->ramdisk_image = 0;
hdr->ramdisk_size = 0;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 42/92] blk-mq: fix race between timeout and CPU hotplug
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (40 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 41/92] x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 43/92] blk-mq: fix CPU hotplug handling Kamal Mostafa
` (49 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Ming Lei, Jens Axboe, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <ming.lei@canonical.com>
commit f054b56c951bf1731ba7314a4c7f1cc0b2977cc9 upstream.
Firstly during CPU hotplug, even queue is freezed, timeout
handler still may come and access hctx->tags, which may cause
use after free, so this patch deactivates timeout handler
inside CPU hotplug notifier.
Secondly, tags can be shared by more than one queues, so we
have to check if the hctx has been unmapped, otherwise
still use-after-free on tags can be triggered.
Reported-by: Dongsu Park <dongsu.park@profitbricks.com>
Tested-by: Dongsu Park <dongsu.park@profitbricks.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
block/blk-mq.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 447f533..621d149 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -673,8 +673,11 @@ static void blk_mq_rq_timer(unsigned long priv)
data.next = blk_rq_timeout(round_jiffies_up(data.next));
mod_timer(&q->timeout, data.next);
} else {
- queue_for_each_hw_ctx(q, hctx, i)
- blk_mq_tag_idle(hctx);
+ queue_for_each_hw_ctx(q, hctx, i) {
+ /* the hctx may be unmapped, so check it here */
+ if (blk_mq_hw_queue_mapped(hctx))
+ blk_mq_tag_idle(hctx);
+ }
}
}
@@ -2076,9 +2079,16 @@ static int blk_mq_queue_reinit_notify(struct notifier_block *nb,
*/
list_for_each_entry(q, &all_q_list, all_q_node)
blk_mq_freeze_queue_start(q);
- list_for_each_entry(q, &all_q_list, all_q_node)
+ list_for_each_entry(q, &all_q_list, all_q_node) {
blk_mq_freeze_queue_wait(q);
+ /*
+ * timeout handler can't touch hw queue during the
+ * reinitialization
+ */
+ del_timer_sync(&q->timeout);
+ }
+
list_for_each_entry(q, &all_q_list, all_q_node)
blk_mq_queue_reinit(q);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 43/92] blk-mq: fix CPU hotplug handling
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (41 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 42/92] blk-mq: fix race between timeout and CPU hotplug Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 44/92] writeback: use |1 instead of +1 to protect against div by zero Kamal Mostafa
` (48 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Ming Lei, Jens Axboe, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <ming.lei@canonical.com>
commit 2a34c0872adf252f23a6fef2d051a169ac796cef upstream.
hctx->tags has to be set as NULL in case that it is to be unmapped
no matter if set->tags[hctx->queue_num] is NULL or not in blk_mq_map_swqueue()
because shared tags can be freed already from another request queue.
The same situation has to be considered during handling CPU online too.
Unmapped hw queue can be remapped after CPU topo is changed, so we need
to allocate tags for the hw queue in blk_mq_map_swqueue(). Then tags
allocation for hw queue can be removed in hctx cpu online notifier, and it
is reasonable to do that after mapping is updated.
Reported-by: Dongsu Park <dongsu.park@profitbricks.com>
Tested-by: Dongsu Park <dongsu.park@profitbricks.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
block/blk-mq.c | 34 +++++++++++++---------------------
1 file changed, 13 insertions(+), 21 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 621d149..c99b3e1 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1574,22 +1574,6 @@ static int blk_mq_hctx_cpu_offline(struct blk_mq_hw_ctx *hctx, int cpu)
return NOTIFY_OK;
}
-static int blk_mq_hctx_cpu_online(struct blk_mq_hw_ctx *hctx, int cpu)
-{
- struct request_queue *q = hctx->queue;
- struct blk_mq_tag_set *set = q->tag_set;
-
- if (set->tags[hctx->queue_num])
- return NOTIFY_OK;
-
- set->tags[hctx->queue_num] = blk_mq_init_rq_map(set, hctx->queue_num);
- if (!set->tags[hctx->queue_num])
- return NOTIFY_STOP;
-
- hctx->tags = set->tags[hctx->queue_num];
- return NOTIFY_OK;
-}
-
static int blk_mq_hctx_notify(void *data, unsigned long action,
unsigned int cpu)
{
@@ -1597,8 +1581,11 @@ static int blk_mq_hctx_notify(void *data, unsigned long action,
if (action == CPU_DEAD || action == CPU_DEAD_FROZEN)
return blk_mq_hctx_cpu_offline(hctx, cpu);
- else if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN)
- return blk_mq_hctx_cpu_online(hctx, cpu);
+
+ /*
+ * In case of CPU online, tags may be reallocated
+ * in blk_mq_map_swqueue() after mapping is updated.
+ */
return NOTIFY_OK;
}
@@ -1780,6 +1767,7 @@ static void blk_mq_map_swqueue(struct request_queue *q)
unsigned int i;
struct blk_mq_hw_ctx *hctx;
struct blk_mq_ctx *ctx;
+ struct blk_mq_tag_set *set = q->tag_set;
queue_for_each_hw_ctx(q, hctx, i) {
cpumask_clear(hctx->cpumask);
@@ -1806,16 +1794,20 @@ static void blk_mq_map_swqueue(struct request_queue *q)
* disable it and free the request entries.
*/
if (!hctx->nr_ctx) {
- struct blk_mq_tag_set *set = q->tag_set;
-
if (set->tags[i]) {
blk_mq_free_rq_map(set, set->tags[i], i);
set->tags[i] = NULL;
- hctx->tags = NULL;
}
+ hctx->tags = NULL;
continue;
}
+ /* unmapped hw queue can be remapped after CPU topo changed */
+ if (!set->tags[i])
+ set->tags[i] = blk_mq_init_rq_map(set, i);
+ hctx->tags = set->tags[i];
+ WARN_ON(!hctx->tags);
+
/*
* Initialize batch roundrobin counts
*/
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 44/92] writeback: use |1 instead of +1 to protect against div by zero
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (42 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 43/92] blk-mq: fix CPU hotplug handling Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 45/92] ARM: mvebu: armada-xp-openblocks-ax3-4: Disable internal RTC Kamal Mostafa
` (47 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Tejun Heo, Jens Axboe, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 464d1387acb94dc43ba772b35242345e3d2ead1b upstream.
mm/page-writeback.c has several places where 1 is added to the divisor
to prevent division by zero exceptions; however, if the original
divisor is equivalent to -1, adding 1 leads to division by zero.
There are three places where +1 is used for this purpose - one in
pos_ratio_polynom() and two in bdi_position_ratio(). The second one
in bdi_position_ratio() actually triggered div-by-zero oops on a
machine running a 3.10 kernel. The divisor is
x_intercept - bdi_setpoint + 1 == span + 1
span is confirmed to be (u32)-1. It isn't clear how it ended up that
but it could be from write bandwidth calculation underflow fixed by
c72efb658f7c ("writeback: fix possible underflow in write bandwidth
calculation").
At any rate, +1 isn't a proper protection against div-by-zero. This
patch converts all +1 protections to |1. Note that
bdi_update_dirty_ratelimit() was already using |1 before this patch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
mm/page-writeback.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index f24d4c9..7bc9aee 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -580,7 +580,7 @@ static long long pos_ratio_polynom(unsigned long setpoint,
long x;
x = div64_s64(((s64)setpoint - (s64)dirty) << RATELIMIT_CALC_SHIFT,
- limit - setpoint + 1);
+ (limit - setpoint) | 1);
pos_ratio = x;
pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT;
pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT;
@@ -807,7 +807,7 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi,
* scale global setpoint to bdi's:
* bdi_setpoint = setpoint * bdi_thresh / thresh
*/
- x = div_u64((u64)bdi_thresh << 16, thresh + 1);
+ x = div_u64((u64)bdi_thresh << 16, thresh | 1);
bdi_setpoint = setpoint * (u64)x >> 16;
/*
* Use span=(8*write_bw) in single bdi case as indicated by
@@ -822,7 +822,7 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi,
if (bdi_dirty < x_intercept - span / 4) {
pos_ratio = div64_u64(pos_ratio * (x_intercept - bdi_dirty),
- x_intercept - bdi_setpoint + 1);
+ (x_intercept - bdi_setpoint) | 1);
} else
pos_ratio /= 4;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 45/92] ARM: mvebu: armada-xp-openblocks-ax3-4: Disable internal RTC
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (43 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 44/92] writeback: use |1 instead of +1 to protect against div by zero Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 46/92] ARM: dts: imx23-olinuxino: Fix polarity of LED GPIO Kamal Mostafa
` (46 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Gregory CLEMENT, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory CLEMENT <gregory.clement@free-electrons.com>
commit 750e30d4076ae5e02ad13a376e96c95a2627742c upstream.
There is no crystal connected to the internal RTC on the Open Block
AX3. So let's disable it in order to prevent the kernel probing the
driver uselessly. Eventually this patches removes the following
warning message from the boot log:
"rtc-mv d0010300.rtc: internal RTC not ticking"
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
index 6f6b091..101c1ec 100644
--- a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
+++ b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
@@ -71,6 +71,10 @@
};
internal-regs {
+ rtc@10300 {
+ /* No crystal connected to the internal RTC */
+ status = "disabled";
+ };
serial@12000 {
status = "okay";
};
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 46/92] ARM: dts: imx23-olinuxino: Fix polarity of LED GPIO
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (44 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 45/92] ARM: mvebu: armada-xp-openblocks-ax3-4: Disable internal RTC Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 47/92] ARM: dts: imx23-olinuxino: Fix dr_mode of usb0 Kamal Mostafa
` (45 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Fabio Estevam, Shawn Guo, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Estevam <fabio.estevam@freescale.com>
commit cfe8c59762244251fd9a5e281d48808095ff4090 upstream.
On imx23-olinuxino the LED turns on when level logic high is aplied to
GPIO2_1.
Fix the gpios property accordingly.
Fixes: b34aa1850244 ("ARM: dts: imx23-olinuxino: Remove unneeded "default-on"")
Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/imx23-olinuxino.dts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index 7e6eef2..839a3b9 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -12,6 +12,7 @@
*/
/dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
#include "imx23.dtsi"
/ {
@@ -122,7 +123,7 @@
user {
label = "green";
- gpios = <&gpio2 1 1>;
+ gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
};
};
};
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 47/92] ARM: dts: imx23-olinuxino: Fix dr_mode of usb0
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (45 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 46/92] ARM: dts: imx23-olinuxino: Fix polarity of LED GPIO Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 48/92] ARM: dts: imx6: phyFLEX: USB VBUS control is active-high Kamal Mostafa
` (44 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Stefan Wahren, Shawn Guo, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <stefan.wahren@i2se.com>
commit 0fdebe1a2f4d3a8fc03754022fabf8ba95e131a3 upstream.
The dr_mode of usb0 on imx233-olinuxino is left to default "otg".
Since the green LED (GPIO2_1) on imx233-olinuxino is connected to the
same pin as USB_OTG_ID it's possible to disable USB host by LED toggling:
echo 0 > /sys/class/leds/green/brightness
[ 1068.890000] ci_hdrc ci_hdrc.0: remove, state 1
[ 1068.890000] usb usb1: USB disconnect, device number 1
[ 1068.920000] usb 1-1: USB disconnect, device number 2
[ 1068.920000] usb 1-1.1: USB disconnect, device number 3
[ 1069.070000] usb 1-1.2: USB disconnect, device number 4
[ 1069.450000] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
[ 1074.460000] ci_hdrc ci_hdrc.0: timeout waiting for 00000800 in 11
This patch fixes the issue by setting dr_mode to "host" in the dts file.
Reported-by: Harald Geyer <harald@ccbib.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Peter Chen <peter.chen@freescale.com>
Fixes: b49312948285 ("ARM: dts: imx23-olinuxino: Add USB host support")
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/imx23-olinuxino.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index 839a3b9..8204539 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -94,6 +94,7 @@
ahb@80080000 {
usb0: usb@80080000 {
+ dr_mode = "host";
vbus-supply = <®_usb0_vbus>;
status = "okay";
};
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 48/92] ARM: dts: imx6: phyFLEX: USB VBUS control is active-high
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (46 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 47/92] ARM: dts: imx23-olinuxino: Fix dr_mode of usb0 Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 49/92] ARM: dts: imx25: Add #pwm-cells to pwm4 Kamal Mostafa
` (43 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Philipp Zabel, Shawn Guo, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Philipp Zabel <p.zabel@pengutronix.de>
commit 7f8d49dcc66a3dd3a8fc3078330b8fb9e616ad3f upstream.
The fixed-regulator bindings require a separate property enable-active-high,
the standard gpio phandle property polarity setting is ignored.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Fixes: 4fe69a934b1f ("ARM: dts: Add Phytec pfla02 with i.MX6 DualLite/Solo")
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
index 19cc269..1ce6133 100644
--- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
@@ -31,6 +31,7 @@
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio4 15 0>;
+ enable-active-high;
};
reg_usb_h1_vbus: regulator@1 {
@@ -40,6 +41,7 @@
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&gpio1 0 0>;
+ enable-active-high;
};
};
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 49/92] ARM: dts: imx25: Add #pwm-cells to pwm4
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (47 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 48/92] ARM: dts: imx6: phyFLEX: USB VBUS control is active-high Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 50/92] ARM: dts: imx28: Fix AUART4 TX-DMA interrupt name Kamal Mostafa
` (42 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Markus Pargmann, Shawn Guo, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Markus Pargmann <mpa@pengutronix.de>
commit f90d3f0d0a11fa77918fd5497cb616dd2faa8431 upstream.
The property '#pwm-cells' is currently missing. It is not possible to
use pwm4 without this property.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Fixes: 5658a68fb578 ("ARM i.MX25: Add devicetree")
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/imx25.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
index e4d3aec..677f81d 100644
--- a/arch/arm/boot/dts/imx25.dtsi
+++ b/arch/arm/boot/dts/imx25.dtsi
@@ -428,6 +428,7 @@
pwm4: pwm@53fc8000 {
compatible = "fsl,imx25-pwm", "fsl,imx27-pwm";
+ #pwm-cells = <2>;
reg = <0x53fc8000 0x4000>;
clocks = <&clks 108>, <&clks 52>;
clock-names = "ipg", "per";
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 50/92] ARM: dts: imx28: Fix AUART4 TX-DMA interrupt name
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (48 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 49/92] ARM: dts: imx25: Add #pwm-cells to pwm4 Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 51/92] [media] marvell-ccic: fix Y'CbCr ordering Kamal Mostafa
` (41 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Marek Vasut, Shawn Guo, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <marex@denx.de>
commit 4ada77e37a773168fea484899201e272ab44ba8b upstream.
Fix a typo in the TX DMA interrupt name for AUART4.
This patch makes AUART4 operational again.
Signed-off-by: Marek Vasut <marex@denx.de>
Fixes: f30fb03d4d3a ("ARM: dts: add generic DMA device tree binding for mxs-dma")
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt | 2 +-
arch/arm/boot/dts/imx28.dtsi | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
index a4873e5..e30e184 100644
--- a/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
+++ b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
@@ -38,7 +38,7 @@ dma_apbx: dma-apbx@80024000 {
80 81 68 69
70 71 72 73
74 75 76 77>;
- interrupt-names = "auart4-rx", "aurat4-tx", "spdif-tx", "empty",
+ interrupt-names = "auart4-rx", "auart4-tx", "spdif-tx", "empty",
"saif0", "saif1", "i2c0", "i2c1",
"auart0-rx", "auart0-tx", "auart1-rx", "auart1-tx",
"auart2-rx", "auart2-tx", "auart3-rx", "auart3-tx";
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 47f68ac..5ed245a 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -900,7 +900,7 @@
80 81 68 69
70 71 72 73
74 75 76 77>;
- interrupt-names = "auart4-rx", "aurat4-tx", "spdif-tx", "empty",
+ interrupt-names = "auart4-rx", "auart4-tx", "spdif-tx", "empty",
"saif0", "saif1", "i2c0", "i2c1",
"auart0-rx", "auart0-tx", "auart1-rx", "auart1-tx",
"auart2-rx", "auart2-tx", "auart3-rx", "auart3-tx";
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 51/92] [media] marvell-ccic: fix Y'CbCr ordering
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (49 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 50/92] ARM: dts: imx28: Fix AUART4 TX-DMA interrupt name Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 52/92] gpio: sysfs: fix memory leaks and device hotplug Kamal Mostafa
` (40 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Hans Verkuil, Mauro Carvalho Chehab, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans Verkuil <hans.verkuil@cisco.com>
commit 2a700d8edffdbfb8200332d96c3147e042b337f1 upstream.
Various formats had their byte ordering implemented incorrectly, and
the V4L2_PIX_FMT_UYVY is actually impossible to create, instead you
get V4L2_PIX_FMT_YVYU.
This was working before commit ad6ac452227b7cb93ac79beec092850d178740b1
("add new formats support for marvell-ccic driver"). That commit broke
the original format support and the OLPC XO-1 laptop showed wrong
colors ever since (if you are crazy enough to attempt to run the latest
kernel on it, like I did).
The email addresses of the authors of that patch are no longer valid,
so without a way to reach them and ask them about their test setup
I am going with what I can test on the OLPC laptop.
If this breaks something for someone on their non-OLPC setup, then
contact the linux-media mailinglist. My suspicion however is that
that commit went in untested.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/media/platform/marvell-ccic/mcam-core.c | 14 +++++++-------
drivers/media/platform/marvell-ccic/mcam-core.h | 8 ++++----
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index 193373f..6e439ef 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -116,8 +116,8 @@ static struct mcam_format_struct {
.planar = false,
},
{
- .desc = "UYVY 4:2:2",
- .pixelformat = V4L2_PIX_FMT_UYVY,
+ .desc = "YVYU 4:2:2",
+ .pixelformat = V4L2_PIX_FMT_YVYU,
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
.bpp = 2,
.planar = false,
@@ -748,7 +748,7 @@ static void mcam_ctlr_image(struct mcam_camera *cam)
switch (fmt->pixelformat) {
case V4L2_PIX_FMT_YUYV:
- case V4L2_PIX_FMT_UYVY:
+ case V4L2_PIX_FMT_YVYU:
widthy = fmt->width * 2;
widthuv = 0;
break;
@@ -784,15 +784,15 @@ static void mcam_ctlr_image(struct mcam_camera *cam)
case V4L2_PIX_FMT_YUV420:
case V4L2_PIX_FMT_YVU420:
mcam_reg_write_mask(cam, REG_CTRL0,
- C0_DF_YUV | C0_YUV_420PL | C0_YUVE_YVYU, C0_DF_MASK);
+ C0_DF_YUV | C0_YUV_420PL | C0_YUVE_VYUY, C0_DF_MASK);
break;
case V4L2_PIX_FMT_YUYV:
mcam_reg_write_mask(cam, REG_CTRL0,
- C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_UYVY, C0_DF_MASK);
+ C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_NOSWAP, C0_DF_MASK);
break;
- case V4L2_PIX_FMT_UYVY:
+ case V4L2_PIX_FMT_YVYU:
mcam_reg_write_mask(cam, REG_CTRL0,
- C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_YUYV, C0_DF_MASK);
+ C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_SWAP24, C0_DF_MASK);
break;
case V4L2_PIX_FMT_JPEG:
mcam_reg_write_mask(cam, REG_CTRL0,
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.h b/drivers/media/platform/marvell-ccic/mcam-core.h
index aa0c6ea..7ffdf4d 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.h
+++ b/drivers/media/platform/marvell-ccic/mcam-core.h
@@ -330,10 +330,10 @@ int mccic_resume(struct mcam_camera *cam);
#define C0_YUVE_YVYU 0x00010000 /* Y1CrY0Cb */
#define C0_YUVE_VYUY 0x00020000 /* CrY1CbY0 */
#define C0_YUVE_UYVY 0x00030000 /* CbY1CrY0 */
-#define C0_YUVE_XYUV 0x00000000 /* 420: .YUV */
-#define C0_YUVE_XYVU 0x00010000 /* 420: .YVU */
-#define C0_YUVE_XUVY 0x00020000 /* 420: .UVY */
-#define C0_YUVE_XVUY 0x00030000 /* 420: .VUY */
+#define C0_YUVE_NOSWAP 0x00000000 /* no bytes swapping */
+#define C0_YUVE_SWAP13 0x00010000 /* swap byte 1 and 3 */
+#define C0_YUVE_SWAP24 0x00020000 /* swap byte 2 and 4 */
+#define C0_YUVE_SWAP1324 0x00030000 /* swap bytes 1&3 and 2&4 */
/* Bayer bits 18,19 if needed */
#define C0_EOF_VSYNC 0x00400000 /* Generate EOF by VSYNC */
#define C0_VEDGE_CTRL 0x00800000 /* Detect falling edge of VSYNC */
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 52/92] gpio: sysfs: fix memory leaks and device hotplug
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (50 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 51/92] [media] marvell-ccic: fix Y'CbCr ordering Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 53/92] ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook Kamal Mostafa
` (39 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Johan Hovold, Linus Walleij, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit 483d821108791092798f5d230686868112927044 upstream.
Unregister GPIOs requested through sysfs at chip remove to avoid leaking
the associated memory and sysfs entries.
The stale sysfs entries prevented the gpio numbers from being exported
when the gpio range was later reused (e.g. at device reconnect).
This also fixes the related module-reference leak.
Note that kernfs makes sure that any on-going sysfs operations finish
before the class devices are unregistered and that further accesses
fail.
The chip exported flag is used to prevent gpiod exports during removal.
This also makes it harder to trigger, but does not fix, the related race
between gpiochip_remove and export_store, which is really a race with
gpiod_request that needs to be addressed separately.
Also note that this would prevent the crashes (e.g. NULL-dereferences)
at reconnect that affects pre-3.18 kernels, as well as use-after-free on
operations on open attribute files on pre-3.14 kernels (prior to
kernfs).
Fixes: d8f388d8dc8d ("gpio: sysfs interface")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpio/gpiolib-sysfs.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 7722ed5..af3bc7a 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -551,6 +551,7 @@ static struct class gpio_class = {
*/
int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
{
+ struct gpio_chip *chip;
unsigned long flags;
int status;
const char *ioname = NULL;
@@ -568,8 +569,16 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
return -EINVAL;
}
+ chip = desc->chip;
+
mutex_lock(&sysfs_lock);
+ /* check if chip is being removed */
+ if (!chip || !chip->exported) {
+ status = -ENODEV;
+ goto fail_unlock;
+ }
+
spin_lock_irqsave(&gpio_lock, flags);
if (!test_bit(FLAG_REQUESTED, &desc->flags) ||
test_bit(FLAG_EXPORT, &desc->flags)) {
@@ -783,12 +792,15 @@ void gpiochip_unexport(struct gpio_chip *chip)
{
int status;
struct device *dev;
+ struct gpio_desc *desc;
+ unsigned int i;
mutex_lock(&sysfs_lock);
dev = class_find_device(&gpio_class, NULL, chip, match_export);
if (dev) {
put_device(dev);
device_unregister(dev);
+ /* prevent further gpiod exports */
chip->exported = false;
status = 0;
} else
@@ -797,6 +809,13 @@ void gpiochip_unexport(struct gpio_chip *chip)
if (status)
chip_dbg(chip, "%s: status %d\n", __func__, status);
+
+ /* unregister gpiod class devices owned by sysfs */
+ for (i = 0; i < chip->ngpio; i++) {
+ desc = &chip->desc[i];
+ if (test_and_clear_bit(FLAG_SYSFS, &desc->flags))
+ gpiod_free(desc);
+ }
}
static int __init gpiolib_sysfs_init(void)
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 53/92] ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (51 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 52/92] gpio: sysfs: fix memory leaks and device hotplug Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 54/92] ACPI / PNP: add two IDs to list for PNPACPI device enumeration Kamal Mostafa
` (38 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Chris Bainbridge, Rafael J. Wysocki, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Bainbridge <chris.bainbridge@gmail.com>
commit 3349fb64b2927407017d970dd5c4daf3c5ad69f8 upstream.
Commit 7bc5a2bad0b8 'ACPI: Support _OSI("Darwin") correctly' caused
the MacBook firmware to expose the SBS, resulting in intermittent
hangs of several minutes on boot, and failure to detect or report
the battery. Fix this by adding a 5 us delay to the start of each
SMBUS transaction. This timing is the result of experimentation -
hangs were observed with 3 us but never with 5 us.
Fixes: 7bc5a2bad0b8 'ACPI: Support _OSI("Darwin") correctly'
Link: https://bugzilla.kernel.org/show_bug.cgi?id=94651
Signed-off-by: Chris Bainbridge <chris.bainbridge@gmail.com>
[ rjw: Subject and changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/acpi/sbshc.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
index 26e5b50..bf034f8 100644
--- a/drivers/acpi/sbshc.c
+++ b/drivers/acpi/sbshc.c
@@ -14,6 +14,7 @@
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/interrupt.h>
+#include <linux/dmi.h>
#include "sbshc.h"
#define PREFIX "ACPI: "
@@ -87,6 +88,8 @@ enum acpi_smb_offset {
ACPI_SMB_ALARM_DATA = 0x26, /* 2 bytes alarm data */
};
+static bool macbook;
+
static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data)
{
return ec_read(hc->offset + address, data);
@@ -132,6 +135,8 @@ static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol,
}
mutex_lock(&hc->lock);
+ if (macbook)
+ udelay(5);
if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp))
goto end;
if (temp) {
@@ -257,12 +262,29 @@ extern int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
acpi_handle handle, acpi_ec_query_func func,
void *data);
+static int macbook_dmi_match(const struct dmi_system_id *d)
+{
+ pr_debug("Detected MacBook, enabling workaround\n");
+ macbook = true;
+ return 0;
+}
+
+static struct dmi_system_id acpi_smbus_dmi_table[] = {
+ { macbook_dmi_match, "Apple MacBook", {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") },
+ },
+ { },
+};
+
static int acpi_smbus_hc_add(struct acpi_device *device)
{
int status;
unsigned long long val;
struct acpi_smb_hc *hc;
+ dmi_check_system(acpi_smbus_dmi_table);
+
if (!device)
return -EINVAL;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 54/92] ACPI / PNP: add two IDs to list for PNPACPI device enumeration
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (52 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 53/92] ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 55/92] ARM: OMAP2+: Fix omap off idle power consumption creeping up Kamal Mostafa
` (37 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Witold Szczeponik, Rafael J. Wysocki, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Witold Szczeponik <Witold.Szczeponik@gmx.net>
commit 622532bb2fad8fe342fb685727ae0be566f6be5d upstream.
Commit eec15edbb0e1 (ACPI / PNP: use device ID list for PNPACPI device
enumeration) changed the way how ACPI devices are enumerated and when
they are added to the PNP bus.
However, it broke the sound card support on (at least) a vintage
IBM ThinkPad 600E: with said commit applied, two of the necessary
"CSC01xx" devices are not added to the PNP bus and hence can not be
found during the initialization of the "snd-cs4236" module. As a
consequence, loading "snd-cs4236" causes null pointer exceptions.
The attached patch fixes the problem end re-enables sound on the
IBM ThinkPad 600E.
Fixes: eec15edbb0e1 (ACPI / PNP: use device ID list for PNPACPI device enumeration)
Signed-off-by: Witold Szczeponik <Witold.Szczeponik@gmx.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/acpi/acpi_pnp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
index b193f84..ff6d8ad 100644
--- a/drivers/acpi/acpi_pnp.c
+++ b/drivers/acpi/acpi_pnp.c
@@ -304,6 +304,8 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = {
{"PNPb006"},
/* cs423x-pnpbios */
{"CSC0100"},
+ {"CSC0103"},
+ {"CSC0110"},
{"CSC0000"},
{"GIM0100"}, /* Guillemot Turtlebeach something appears to be cs4232 compatible */
/* es18xx-pnpbios */
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 55/92] ARM: OMAP2+: Fix omap off idle power consumption creeping up
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (53 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 54/92] ACPI / PNP: add two IDs to list for PNPACPI device enumeration Kamal Mostafa
@ 2015-05-26 15:40 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 56/92] ARM: dts: OMAP3-N900: Add microphone bias voltages Kamal Mostafa
` (36 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:40 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Kevin Hilman, Tero Kristo, Tony Lindgren, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <tony@atomide.com>
commit 102bcb6ed2d1c3ffcc7269afc957c2df11942085 upstream.
If we use a combination of VMODE and I2C4 for retention modes,
eventually the off idle power consumption will creep up by about
23mW, even during off mode with I2C4 always staying enabled.
Turns out this is because of erratum i531 "Extra Power Consumed
When Repeated Start Operation Mode Is Enabled on I2C Interface
Dedicated for Smart Reflex (I2C4)" as pointed out by Nishanth
Menon <nm@ti.com>.
Let's fix the issue by adding i2c_cfg_clear_mask for the bits
to clear when initializing the I2C4 adapter so we can clear
SREN bit that drives the I2C4 lines low otherwise when there
is no traffic.
Fixes: 3b8c4ebb7630 ("ARM: OMAP3: Fix idle mode signaling for
sys_clkreq and sys_off_mode")
Cc: Kevin Hilman <khilman@kernel.org>
Cc: Tero Kristo <t-kristo@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/mach-omap2/prm-regbits-34xx.h | 1 +
arch/arm/mach-omap2/prm-regbits-44xx.h | 1 +
arch/arm/mach-omap2/vc.c | 12 ++++++++++--
arch/arm/mach-omap2/vc.h | 2 ++
arch/arm/mach-omap2/vc3xxx_data.c | 1 +
arch/arm/mach-omap2/vc44xx_data.c | 1 +
6 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h
index cbefbd7..661d753 100644
--- a/arch/arm/mach-omap2/prm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-34xx.h
@@ -112,6 +112,7 @@
#define OMAP3430_VC_CMD_ONLP_SHIFT 16
#define OMAP3430_VC_CMD_RET_SHIFT 8
#define OMAP3430_VC_CMD_OFF_SHIFT 0
+#define OMAP3430_SREN_MASK (1 << 4)
#define OMAP3430_HSEN_MASK (1 << 3)
#define OMAP3430_MCODE_MASK (0x7 << 0)
#define OMAP3430_VALID_MASK (1 << 24)
diff --git a/arch/arm/mach-omap2/prm-regbits-44xx.h b/arch/arm/mach-omap2/prm-regbits-44xx.h
index b1c7a33..e794828 100644
--- a/arch/arm/mach-omap2/prm-regbits-44xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-44xx.h
@@ -35,6 +35,7 @@
#define OMAP4430_GLOBAL_WARM_SW_RST_SHIFT 1
#define OMAP4430_GLOBAL_WUEN_MASK (1 << 16)
#define OMAP4430_HSMCODE_MASK (0x7 << 0)
+#define OMAP4430_SRMODEEN_MASK (1 << 4)
#define OMAP4430_HSMODEEN_MASK (1 << 3)
#define OMAP4430_HSSCLL_SHIFT 24
#define OMAP4430_ICEPICK_RST_SHIFT 9
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index be9ef83..076fd20 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -316,7 +316,8 @@ static void __init omap3_vc_init_pmic_signaling(struct voltagedomain *voltdm)
* idle. And we can also scale voltages to zero for off-idle.
* Note that no actual voltage scaling during off-idle will
* happen unless the board specific twl4030 PMIC scripts are
- * loaded.
+ * loaded. See also omap_vc_i2c_init for comments regarding
+ * erratum i531.
*/
val = voltdm->read(OMAP3_PRM_VOLTCTRL_OFFSET);
if (!(val & OMAP3430_PRM_VOLTCTRL_SEL_OFF)) {
@@ -704,9 +705,16 @@ static void __init omap_vc_i2c_init(struct voltagedomain *voltdm)
return;
}
+ /*
+ * Note that for omap3 OMAP3430_SREN_MASK clears SREN to work around
+ * erratum i531 "Extra Power Consumed When Repeated Start Operation
+ * Mode Is Enabled on I2C Interface Dedicated for Smart Reflex (I2C4)".
+ * Otherwise I2C4 eventually leads into about 23mW extra power being
+ * consumed even during off idle using VMODE.
+ */
i2c_high_speed = voltdm->pmic->i2c_high_speed;
if (i2c_high_speed)
- voltdm->rmw(vc->common->i2c_cfg_hsen_mask,
+ voltdm->rmw(vc->common->i2c_cfg_clear_mask,
vc->common->i2c_cfg_hsen_mask,
vc->common->i2c_cfg_reg);
diff --git a/arch/arm/mach-omap2/vc.h b/arch/arm/mach-omap2/vc.h
index cdbdd78..89b83b7 100644
--- a/arch/arm/mach-omap2/vc.h
+++ b/arch/arm/mach-omap2/vc.h
@@ -34,6 +34,7 @@ struct voltagedomain;
* @cmd_ret_shift: RET field shift in PRM_VC_CMD_VAL_* register
* @cmd_off_shift: OFF field shift in PRM_VC_CMD_VAL_* register
* @i2c_cfg_reg: I2C configuration register offset
+ * @i2c_cfg_clear_mask: high-speed mode bit clear mask in I2C config register
* @i2c_cfg_hsen_mask: high-speed mode bit field mask in I2C config register
* @i2c_mcode_mask: MCODE field mask for I2C config register
*
@@ -52,6 +53,7 @@ struct omap_vc_common {
u8 cmd_ret_shift;
u8 cmd_off_shift;
u8 i2c_cfg_reg;
+ u8 i2c_cfg_clear_mask;
u8 i2c_cfg_hsen_mask;
u8 i2c_mcode_mask;
};
diff --git a/arch/arm/mach-omap2/vc3xxx_data.c b/arch/arm/mach-omap2/vc3xxx_data.c
index 75bc4aa..71d74c9 100644
--- a/arch/arm/mach-omap2/vc3xxx_data.c
+++ b/arch/arm/mach-omap2/vc3xxx_data.c
@@ -40,6 +40,7 @@ static struct omap_vc_common omap3_vc_common = {
.cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT,
.cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT,
.cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT,
+ .i2c_cfg_clear_mask = OMAP3430_SREN_MASK | OMAP3430_HSEN_MASK,
.i2c_cfg_hsen_mask = OMAP3430_HSEN_MASK,
.i2c_cfg_reg = OMAP3_PRM_VC_I2C_CFG_OFFSET,
.i2c_mcode_mask = OMAP3430_MCODE_MASK,
diff --git a/arch/arm/mach-omap2/vc44xx_data.c b/arch/arm/mach-omap2/vc44xx_data.c
index 085e5d6..2abd5fa 100644
--- a/arch/arm/mach-omap2/vc44xx_data.c
+++ b/arch/arm/mach-omap2/vc44xx_data.c
@@ -42,6 +42,7 @@ static const struct omap_vc_common omap4_vc_common = {
.cmd_ret_shift = OMAP4430_RET_SHIFT,
.cmd_off_shift = OMAP4430_OFF_SHIFT,
.i2c_cfg_reg = OMAP4_PRM_VC_CFG_I2C_MODE_OFFSET,
+ .i2c_cfg_clear_mask = OMAP4430_SRMODEEN_MASK | OMAP4430_HSMODEEN_MASK,
.i2c_cfg_hsen_mask = OMAP4430_HSMODEEN_MASK,
.i2c_mcode_mask = OMAP4430_HSMCODE_MASK,
};
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 56/92] ARM: dts: OMAP3-N900: Add microphone bias voltages
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (54 preceding siblings ...)
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 55/92] ARM: OMAP2+: Fix omap off idle power consumption creeping up Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 57/92] drm/radeon: disable semaphores for UVD V1 (v2) Kamal Mostafa
` (35 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Pavel Machek, Jarkko Nikula, Tony Lindgren, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Machek <pavel@ucw.cz>
commit 1819e3034ee26ffadc71880064ed8b8e7d74f52c upstream.
N900 audio recording needs that codec provides bias voltage for integrated
digital microphone and headset microphone depending which one is used.
Digital microphone uses 2 V bias and it comes from the codec A part. Codec
B part drives the headset microphone bias and that is set to 2.5 V.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
[Jarkko: Headset mic bias changed to 2 (2.5 V) as it was before commit
e2e8bfdf6157 ("ASoC: tlv320aic3x: Convert mic bias to a supply widget")]
Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/omap3-n900.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index b550c41..f7858f5 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -478,6 +478,8 @@
DRVDD-supply = <&vmmc2>;
IOVDD-supply = <&vio>;
DVDD-supply = <&vio>;
+
+ ai3x-micbias-vg = <1>;
};
tlv320aic3x_aux: tlv320aic3x@19 {
@@ -489,6 +491,8 @@
DRVDD-supply = <&vmmc2>;
IOVDD-supply = <&vio>;
DVDD-supply = <&vio>;
+
+ ai3x-micbias-vg = <2>;
};
tsl2563: tsl2563@29 {
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 57/92] drm/radeon: disable semaphores for UVD V1 (v2)
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (55 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 56/92] ARM: dts: OMAP3-N900: Add microphone bias voltages Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 58/92] x86/spinlocks: Fix regression in spinlock contention detection Kamal Mostafa
` (34 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christian König, Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
commit 013ead48a843442e63b9426e3bd5df18ca5d054a upstream.
Hardware doesn't seem to work correctly, just block userspace in this case.
v2: add missing defines
Bugs: https://bugs.freedesktop.org/show_bug.cgi?id=85320
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_asic.c | 2 +-
drivers/gpu/drm/radeon/radeon_asic.h | 4 ++++
drivers/gpu/drm/radeon/rv770d.h | 3 +++
drivers/gpu/drm/radeon/uvd_v1_0.c | 14 ++------------
drivers/gpu/drm/radeon/uvd_v2_2.c | 29 +++++++++++++++++++++++++++++
5 files changed, 39 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index ed0e10e..c34ceb8 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -1190,7 +1190,7 @@ static struct radeon_asic rs780_asic = {
static struct radeon_asic_ring rv770_uvd_ring = {
.ib_execute = &uvd_v1_0_ib_execute,
.emit_fence = &uvd_v2_2_fence_emit,
- .emit_semaphore = &uvd_v1_0_semaphore_emit,
+ .emit_semaphore = &uvd_v2_2_semaphore_emit,
.cs_parse = &radeon_uvd_cs_parse,
.ring_test = &uvd_v1_0_ring_test,
.ib_test = &uvd_v1_0_ib_test,
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index 8d787d1..b427a36 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -914,6 +914,10 @@ void uvd_v1_0_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
int uvd_v2_2_resume(struct radeon_device *rdev);
void uvd_v2_2_fence_emit(struct radeon_device *rdev,
struct radeon_fence *fence);
+bool uvd_v2_2_semaphore_emit(struct radeon_device *rdev,
+ struct radeon_ring *ring,
+ struct radeon_semaphore *semaphore,
+ bool emit_wait);
/* uvd v3.1 */
bool uvd_v3_1_semaphore_emit(struct radeon_device *rdev,
diff --git a/drivers/gpu/drm/radeon/rv770d.h b/drivers/gpu/drm/radeon/rv770d.h
index 3cf1e29..9ef2064 100644
--- a/drivers/gpu/drm/radeon/rv770d.h
+++ b/drivers/gpu/drm/radeon/rv770d.h
@@ -989,6 +989,9 @@
((n) & 0x3FFF) << 16)
/* UVD */
+#define UVD_SEMA_ADDR_LOW 0xef00
+#define UVD_SEMA_ADDR_HIGH 0xef04
+#define UVD_SEMA_CMD 0xef08
#define UVD_GPCOM_VCPU_CMD 0xef0c
#define UVD_GPCOM_VCPU_DATA0 0xef10
#define UVD_GPCOM_VCPU_DATA1 0xef14
diff --git a/drivers/gpu/drm/radeon/uvd_v1_0.c b/drivers/gpu/drm/radeon/uvd_v1_0.c
index e72b3cb..c6b1cbc 100644
--- a/drivers/gpu/drm/radeon/uvd_v1_0.c
+++ b/drivers/gpu/drm/radeon/uvd_v1_0.c
@@ -466,18 +466,8 @@ bool uvd_v1_0_semaphore_emit(struct radeon_device *rdev,
struct radeon_semaphore *semaphore,
bool emit_wait)
{
- uint64_t addr = semaphore->gpu_addr;
-
- radeon_ring_write(ring, PACKET0(UVD_SEMA_ADDR_LOW, 0));
- radeon_ring_write(ring, (addr >> 3) & 0x000FFFFF);
-
- radeon_ring_write(ring, PACKET0(UVD_SEMA_ADDR_HIGH, 0));
- radeon_ring_write(ring, (addr >> 23) & 0x000FFFFF);
-
- radeon_ring_write(ring, PACKET0(UVD_SEMA_CMD, 0));
- radeon_ring_write(ring, emit_wait ? 1 : 0);
-
- return true;
+ /* disable semaphores for UVD V1 hardware */
+ return false;
}
/**
diff --git a/drivers/gpu/drm/radeon/uvd_v2_2.c b/drivers/gpu/drm/radeon/uvd_v2_2.c
index 8919351..7ed778c 100644
--- a/drivers/gpu/drm/radeon/uvd_v2_2.c
+++ b/drivers/gpu/drm/radeon/uvd_v2_2.c
@@ -60,6 +60,35 @@ void uvd_v2_2_fence_emit(struct radeon_device *rdev,
}
/**
+ * uvd_v2_2_semaphore_emit - emit semaphore command
+ *
+ * @rdev: radeon_device pointer
+ * @ring: radeon_ring pointer
+ * @semaphore: semaphore to emit commands for
+ * @emit_wait: true if we should emit a wait command
+ *
+ * Emit a semaphore command (either wait or signal) to the UVD ring.
+ */
+bool uvd_v2_2_semaphore_emit(struct radeon_device *rdev,
+ struct radeon_ring *ring,
+ struct radeon_semaphore *semaphore,
+ bool emit_wait)
+{
+ uint64_t addr = semaphore->gpu_addr;
+
+ radeon_ring_write(ring, PACKET0(UVD_SEMA_ADDR_LOW, 0));
+ radeon_ring_write(ring, (addr >> 3) & 0x000FFFFF);
+
+ radeon_ring_write(ring, PACKET0(UVD_SEMA_ADDR_HIGH, 0));
+ radeon_ring_write(ring, (addr >> 23) & 0x000FFFFF);
+
+ radeon_ring_write(ring, PACKET0(UVD_SEMA_CMD, 0));
+ radeon_ring_write(ring, emit_wait ? 1 : 0);
+
+ return true;
+}
+
+/**
* uvd_v2_2_resume - memory controller programming
*
* @rdev: radeon_device pointer
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 58/92] x86/spinlocks: Fix regression in spinlock contention detection
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (56 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 57/92] drm/radeon: disable semaphores for UVD V1 (v2) Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 59/92] RDMA/CMA: Canonize IPv4 on IPV6 sockets properly Kamal Mostafa
` (33 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Tahsin Erdogan, peterz, Waiman.Long, borntraeger, oleg,
raghavendra.kt, Thomas Gleixner, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Tahsin Erdogan <tahsin@google.com>
commit e8a4a2696fecb398b0288c43c0e0dbb91e265bb2 upstream.
A spinlock is regarded as contended when there is at least one waiter.
Currently, the code that checks whether there are any waiters rely on
tail value being greater than head. However, this is not true if tail
reaches the max value and wraps back to zero, so arch_spin_is_contended()
incorrectly returns 0 (not contended) when tail is smaller than head.
The original code (before regression) handled this case by casting the
(tail - head) to an unsigned value. This change simply restores that
behavior.
Fixes: d6abfdb20223 ("x86/spinlocks/paravirt: Fix memory corruption on unlock")
Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Cc: peterz@infradead.org
Cc: Waiman.Long@hp.com
Cc: borntraeger@de.ibm.com
Cc: oleg@redhat.com
Cc: raghavendra.kt@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/1430799331-20445-1-git-send-email-tahsin@google.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/x86/include/asm/spinlock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index cf87de3..64b6117 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -169,7 +169,7 @@ static inline int arch_spin_is_contended(arch_spinlock_t *lock)
struct __raw_tickets tmp = READ_ONCE(lock->tickets);
tmp.head &= ~TICKET_SLOWPATH_FLAG;
- return (tmp.tail - tmp.head) > TICKET_LOCK_INC;
+ return (__ticket_t)(tmp.tail - tmp.head) > TICKET_LOCK_INC;
}
#define arch_spin_is_contended arch_spin_is_contended
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 59/92] RDMA/CMA: Canonize IPv4 on IPV6 sockets properly
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (57 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 58/92] x86/spinlocks: Fix regression in spinlock contention detection Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 60/92] drm/i915: Assume dual channel LVDS if pixel clock necessitates it Kamal Mostafa
` (32 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Jason Gunthorpe, Doug Ledford, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
commit 285214409a9e5fceba2215461b4682b6069d8e77 upstream.
When accepting a new IPv4 connect to an IPv6 socket, the CMA tries to
canonize the address family to IPv4, but does not properly process
the listening sockaddr to get the listening port, and does not properly
set the address family of the canonized sockaddr.
Fixes: e51060f08a61 ("IB: IP address based RDMA connection manager")
Reported-By: Yotam Kenneth <yotamke@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/infiniband/core/cma.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index d570030..06441a4 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -859,19 +859,27 @@ static void cma_save_ib_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_id
memcpy(&ib->sib_addr, &path->dgid, 16);
}
+static __be16 ss_get_port(const struct sockaddr_storage *ss)
+{
+ if (ss->ss_family == AF_INET)
+ return ((struct sockaddr_in *)ss)->sin_port;
+ else if (ss->ss_family == AF_INET6)
+ return ((struct sockaddr_in6 *)ss)->sin6_port;
+ BUG();
+}
+
static void cma_save_ip4_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_id,
struct cma_hdr *hdr)
{
- struct sockaddr_in *listen4, *ip4;
+ struct sockaddr_in *ip4;
- listen4 = (struct sockaddr_in *) &listen_id->route.addr.src_addr;
ip4 = (struct sockaddr_in *) &id->route.addr.src_addr;
- ip4->sin_family = listen4->sin_family;
+ ip4->sin_family = AF_INET;
ip4->sin_addr.s_addr = hdr->dst_addr.ip4.addr;
- ip4->sin_port = listen4->sin_port;
+ ip4->sin_port = ss_get_port(&listen_id->route.addr.src_addr);
ip4 = (struct sockaddr_in *) &id->route.addr.dst_addr;
- ip4->sin_family = listen4->sin_family;
+ ip4->sin_family = AF_INET;
ip4->sin_addr.s_addr = hdr->src_addr.ip4.addr;
ip4->sin_port = hdr->port;
}
@@ -879,16 +887,15 @@ static void cma_save_ip4_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_i
static void cma_save_ip6_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_id,
struct cma_hdr *hdr)
{
- struct sockaddr_in6 *listen6, *ip6;
+ struct sockaddr_in6 *ip6;
- listen6 = (struct sockaddr_in6 *) &listen_id->route.addr.src_addr;
ip6 = (struct sockaddr_in6 *) &id->route.addr.src_addr;
- ip6->sin6_family = listen6->sin6_family;
+ ip6->sin6_family = AF_INET6;
ip6->sin6_addr = hdr->dst_addr.ip6;
- ip6->sin6_port = listen6->sin6_port;
+ ip6->sin6_port = ss_get_port(&listen_id->route.addr.src_addr);
ip6 = (struct sockaddr_in6 *) &id->route.addr.dst_addr;
- ip6->sin6_family = listen6->sin6_family;
+ ip6->sin6_family = AF_INET6;
ip6->sin6_addr = hdr->src_addr.ip6;
ip6->sin6_port = hdr->port;
}
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 60/92] drm/i915: Assume dual channel LVDS if pixel clock necessitates it
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (58 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 59/92] RDMA/CMA: Canonize IPv4 on IPV6 sockets properly Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 61/92] drm/i915: Add missing MacBook Pro models with dual channel LVDS Kamal Mostafa
` (31 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lukas Wunner, Jani Nikula, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Wunner <lukas@wunner.de>
commit 6f317cfe42c9d8a7c9c1a327d2f1bcc517a3cd91 upstream.
Single channel LVDS maxes out at 112 MHz, anything above must be dual
channel. This avoids the need to specify i915.lvds_channel_mode=2 on
all 17" MacBook Pro models with i915 graphics since they had 1920x1200
(193 MHz), plus those 15" pre-retina models which had a resolution
of 1680x1050 (119 MHz) as a BTO option.
Source for 112 MHz limit of single channel LVDS is section 2.3 of:
https://01.org/linuxgraphics/sites/default/files/documentation/ivb_ihd_os_vol3_part4.pdf
v2: Avoid hardcoding 17" models by assuming dual channel LVDS if the
resolution necessitates it, suggested by Jani Nikula.
v3: Fix typo, thanks Joonas Lahtinen.
v4: Split commit in two, suggested by Ville Syrjälä.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Tested-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[Jani: included spec reference into the commit message]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_lvds.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 14654d6..86bab42 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -844,6 +844,11 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
if (i915.lvds_channel_mode > 0)
return i915.lvds_channel_mode == 2;
+ /* single channel LVDS is limited to 112 MHz */
+ if (lvds_encoder->attached_connector->base.panel.fixed_mode->clock
+ > 112999)
+ return true;
+
if (dmi_check_system(intel_dual_link_lvds))
return true;
@@ -1101,6 +1106,8 @@ void intel_lvds_init(struct drm_device *dev)
out:
mutex_unlock(&dev->mode_config.mutex);
+ intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
+
lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);
DRM_DEBUG_KMS("detected %s-link lvds configuration\n",
lvds_encoder->is_dual_link ? "dual" : "single");
@@ -1115,7 +1122,6 @@ out:
}
drm_connector_register(connector);
- intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
intel_panel_setup_backlight(connector, INVALID_PIPE);
return;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 61/92] drm/i915: Add missing MacBook Pro models with dual channel LVDS
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (59 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 60/92] drm/i915: Assume dual channel LVDS if pixel clock necessitates it Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 62/92] efi: Fix error handling in add_sysfs_runtime_map_entry() Kamal Mostafa
` (30 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Lukas Wunner, Jani Nikula, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Wunner <lukas@wunner.de>
commit 3916e3fd81021fb795bfbdb17f375b6b3685bced upstream.
Single channel LVDS maxes out at 112 MHz. The 15" pre-retina models
shipped with 1440x900 (106 MHz) by default or 1680x1050 (119 MHz)
as a BTO option, both versions used dual channel LVDS even though
the smaller one would have fit into a single channel.
Notes:
Bug report showing that the MacBookPro8,2 with 1440x900 uses dual
channel LVDS (this lead to it being hardcoded in intel_lvds.c by
Daniel Vetter with commit 618563e3945b9d0864154bab3c607865b557cecc):
https://bugzilla.kernel.org/show_bug.cgi?id=42842
If i915.lvds_channel_mode=2 is missing even though the machine needs
it, every other vertical line is white and consequently, only the left
half of the screen is visible (verified by myself on a MacBookPro9,1).
Forum posting concerning a MacBookPro6,2 with 1440x900, author is
using i915.lvds_channel_mode=2 on the kernel command line, proving
that the machine uses dual channels:
https://bbs.archlinux.org/viewtopic.php?id=185770
Chi Mei N154C6-L04 with 1440x900 is a replacement panel for all
MacBook Pro "A1286" models, and that model number encompasses the
MacBookPro6,2 / 8,2 / 9,1. Page 17 of the panel's datasheet shows it's
driven with dual channel LVDS:
http://www.ebay.com/itm/-/400690878560
http://www.everymac.com/ultimate-mac-lookup/?search_keywords=A1286
http://www.taopanel.com/chimei/datasheet/N154C6-L04.pdf
Those three 15" models, MacBookPro6,2 / 8,2 / 9,1, are the only ones
with i915 graphics and dual channel LVDS, so that list should be
complete. And the 8,2 is already in intel_lvds.c.
Possible motivation to use dual channel LVDS even on the 1440x900
models: Reduce the number of different parts, i.e. use identical logic
boards and display cabling on both versions and the only differing
component is the panel.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Jani Nikula <jani.nikula@intel.com>
[Jani: included notes in the commit message for posterity]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_lvds.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 86bab42..2dcda09 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -809,12 +809,28 @@ static int intel_dual_link_lvds_callback(const struct dmi_system_id *id)
static const struct dmi_system_id intel_dual_link_lvds[] = {
{
.callback = intel_dual_link_lvds_callback,
- .ident = "Apple MacBook Pro (Core i5/i7 Series)",
+ .ident = "Apple MacBook Pro 15\" (2010)",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro6,2"),
+ },
+ },
+ {
+ .callback = intel_dual_link_lvds_callback,
+ .ident = "Apple MacBook Pro 15\" (2011)",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro8,2"),
},
},
+ {
+ .callback = intel_dual_link_lvds_callback,
+ .ident = "Apple MacBook Pro 15\" (2012)",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro9,1"),
+ },
+ },
{ } /* terminating entry */
};
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 62/92] efi: Fix error handling in add_sysfs_runtime_map_entry()
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (60 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 61/92] drm/i915: Add missing MacBook Pro models with dual channel LVDS Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 63/92] Revert "dm crypt: fix deadlock when async crypto algorithm returns -EBUSY" Kamal Mostafa
` (29 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Carpenter, Dave Young, Guangyu Sun, Matt Fleming, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit d67e199611b986b345ea3087ee2e4a15da1c98b3 upstream.
I spotted two (difficult to hit) bugs while reviewing this.
1) There is a double free bug because we unregister "map_kset" in
add_sysfs_runtime_map_entry() and also efi_runtime_map_init().
2) If we fail to allocate "entry" then we should return
ERR_PTR(-ENOMEM) instead of NULL.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Guangyu Sun <guangyu.sun@oracle.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/firmware/efi/runtime-map.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/efi/runtime-map.c b/drivers/firmware/efi/runtime-map.c
index 87b8e3b..5c55227 100644
--- a/drivers/firmware/efi/runtime-map.c
+++ b/drivers/firmware/efi/runtime-map.c
@@ -120,7 +120,8 @@ add_sysfs_runtime_map_entry(struct kobject *kobj, int nr)
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
if (!entry) {
kset_unregister(map_kset);
- return entry;
+ map_kset = NULL;
+ return ERR_PTR(-ENOMEM);
}
memcpy(&entry->md, efi_runtime_map + nr * efi_memdesc_size,
@@ -132,6 +133,7 @@ add_sysfs_runtime_map_entry(struct kobject *kobj, int nr)
if (ret) {
kobject_put(&entry->kobj);
kset_unregister(map_kset);
+ map_kset = NULL;
return ERR_PTR(ret);
}
@@ -195,8 +197,6 @@ out_add_entry:
entry = *(map_entries + j);
kobject_put(&entry->kobj);
}
- if (map_kset)
- kset_unregister(map_kset);
out:
return ret;
}
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 63/92] Revert "dm crypt: fix deadlock when async crypto algorithm returns -EBUSY"
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (61 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 62/92] efi: Fix error handling in add_sysfs_runtime_map_entry() Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 64/92] xen/events: Clear cpu_evtchn_mask before resuming Kamal Mostafa
` (28 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Rabin Vincent, Mike Snitzer, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Rabin Vincent <rabin.vincent@axis.com>
commit c0403ec0bb5a8c5b267fb7e16021bec0b17e4964 upstream.
This reverts Linux 4.1-rc1 commit 0618764cb25f6fa9fb31152995de42a8a0496475.
The problem which that commit attempts to fix actually lies in the
Freescale CAAM crypto driver not dm-crypt.
dm-crypt uses CRYPTO_TFM_REQ_MAY_BACKLOG. This means the the crypto
driver should internally backlog requests which arrive when the queue is
full and process them later. Until the crypto hw's queue becomes full,
the driver returns -EINPROGRESS. When the crypto hw's queue if full,
the driver returns -EBUSY, and if CRYPTO_TFM_REQ_MAY_BACKLOG is set, is
expected to backlog the request and process it when the hardware has
queue space. At the point when the driver takes the request from the
backlog and starts processing it, it calls the completion function with
a status of -EINPROGRESS. The completion function is called (for a
second time, in the case of backlogged requests) with a status/err of 0
when a request is done.
Crypto drivers for hardware without hardware queueing use the helpers,
crypto_init_queue(), crypto_enqueue_request(), crypto_dequeue_request()
and crypto_get_backlog() helpers to implement this behaviour correctly,
while others implement this behaviour without these helpers (ccp, for
example).
dm-crypt (before the patch that needs reverting) uses this API
correctly. It queues up as many requests as the hw queues will allow
(i.e. as long as it gets back -EINPROGRESS from the request function).
Then, when it sees at least one backlogged request (gets -EBUSY), it
waits till that backlogged request is handled (completion gets called
with -EINPROGRESS), and then continues. The references to
af_alg_wait_for_completion() and af_alg_complete() in that commit's
commit message are irrelevant because those functions only handle one
request at a time, unlink dm-crypt.
The problem is that the Freescale CAAM driver, which that commit
describes as having being tested with, fails to implement the
backlogging behaviour correctly. In cam_jr_enqueue(), if the hardware
queue is full, it simply returns -EBUSY without backlogging the request.
What the observed deadlock was is not described in the commit message
but it is obviously the wait_for_completion() in crypto_convert() where
dm-crypto would wait for the completion being called with -EINPROGRESS
in the case of backlogged requests. This completion will never be
completed due to the bug in the CAAM driver.
Commit 0618764cb25 incorrectly made dm-crypt wait for every request,
even when the driver/hardware queues are not full, which means that
dm-crypt will never see -EBUSY. This means that that commit will cause
a performance regression on all crypto drivers which implement the API
correctly.
Revert it. Correct backlog handling should be implemented in the CAAM
driver instead.
Cc'ing stable purely because commit 0618764cb25 did. If for some reason
a stable@ kernel did pick up commit 0618764cb25 it should get reverted.
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Reviewed-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/dm-crypt.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index a9f2266..08981be 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -920,10 +920,11 @@ static int crypt_convert(struct crypt_config *cc,
switch (r) {
/* async */
- case -EINPROGRESS:
case -EBUSY:
wait_for_completion(&ctx->restart);
reinit_completion(&ctx->restart);
+ /* fall through*/
+ case -EINPROGRESS:
ctx->req = NULL;
ctx->cc_sector++;
continue;
@@ -1314,8 +1315,10 @@ static void kcryptd_async_done(struct crypto_async_request *async_req,
struct dm_crypt_io *io = container_of(ctx, struct dm_crypt_io, ctx);
struct crypt_config *cc = io->cc;
- if (error == -EINPROGRESS)
+ if (error == -EINPROGRESS) {
+ complete(&ctx->restart);
return;
+ }
if (!error && cc->iv_gen_ops && cc->iv_gen_ops->post)
error = cc->iv_gen_ops->post(cc, iv_of_dmreq(cc, dmreq), dmreq);
@@ -1326,15 +1329,12 @@ static void kcryptd_async_done(struct crypto_async_request *async_req,
crypt_free_req(cc, req_of_dmreq(cc, dmreq), io->base_bio);
if (!atomic_dec_and_test(&ctx->cc_pending))
- goto done;
+ return;
if (bio_data_dir(io->base_bio) == READ)
kcryptd_crypt_read_done(io);
else
kcryptd_crypt_write_io_submit(io, 1);
-done:
- if (!completion_done(&ctx->restart))
- complete(&ctx->restart);
}
static void kcryptd_crypt(struct work_struct *work)
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 64/92] xen/events: Clear cpu_evtchn_mask before resuming
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (62 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 63/92] Revert "dm crypt: fix deadlock when async crypto algorithm returns -EBUSY" Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 65/92] xen/xenbus: Update xenbus event channel on resume Kamal Mostafa
` (27 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Boris Ostrovsky, David Vrabel, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
commit 5cec98834989a014a9560b1841649eaca95cf00e upstream.
When a guest is resumed, the hypervisor may change event channel
assignments. If this happens and the guest uses 2-level events it
is possible for the interrupt to be claimed by wrong VCPU since
cpu_evtchn_mask bits may be stale. This can happen even though
evtchn_2l_bind_to_cpu() attempts to clear old bits: irq_info that
is passed in is not necessarily the original one (from pre-migration
times) but instead is freshly allocated during resume and so any
information about which CPU the channel was bound to is lost.
Thus we should clear the mask during resume.
We also need to make sure that bits for xenstore and console channels
are set when these two subsystems are resumed. While rebind_evtchn_irq()
(which is invoked for both of them on a resume) calls irq_set_affinity(),
the latter will in fact postpone setting affinity until handling the
interrupt. But because cpu_evtchn_mask will have bits for these two
cleared we won't be able to take the interrupt.
With that in mind, we need to bind those two channels explicitly in
rebind_evtchn_irq(). We will keep irq_set_affinity() so that we have a
pass through generic irq affinity code later, in case something needs
to be updated there as well.
(Also replace cpumask_of(0) with cpumask_of(info->cpu) in
rebind_evtchn_irq(): it should be set to zero in preceding
xen_irq_info_evtchn_setup().)
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reported-by: Annie Li <annie.li@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/xen/events/events_2l.c | 10 ++++++++++
drivers/xen/events/events_base.c | 5 +++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/events/events_2l.c b/drivers/xen/events/events_2l.c
index 5db43fc..7dd4631 100644
--- a/drivers/xen/events/events_2l.c
+++ b/drivers/xen/events/events_2l.c
@@ -345,6 +345,15 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
+static void evtchn_2l_resume(void)
+{
+ int i;
+
+ for_each_online_cpu(i)
+ memset(per_cpu(cpu_evtchn_mask, i), 0, sizeof(xen_ulong_t) *
+ EVTCHN_2L_NR_CHANNELS/BITS_PER_EVTCHN_WORD);
+}
+
static const struct evtchn_ops evtchn_ops_2l = {
.max_channels = evtchn_2l_max_channels,
.nr_channels = evtchn_2l_max_channels,
@@ -356,6 +365,7 @@ static const struct evtchn_ops evtchn_ops_2l = {
.mask = evtchn_2l_mask,
.unmask = evtchn_2l_unmask,
.handle_events = evtchn_2l_handle_events,
+ .resume = evtchn_2l_resume,
};
void __init xen_evtchn_2l_init(void)
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 70fba97..a1ec564 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1279,8 +1279,9 @@ void rebind_evtchn_irq(int evtchn, int irq)
mutex_unlock(&irq_mapping_update_lock);
- /* new event channels are always bound to cpu 0 */
- irq_set_affinity(irq, cpumask_of(0));
+ bind_evtchn_to_cpu(evtchn, info->cpu);
+ /* This will be deferred until interrupt is processed */
+ irq_set_affinity(irq, cpumask_of(info->cpu));
/* Unmask the event channel. */
enable_irq(irq);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 65/92] xen/xenbus: Update xenbus event channel on resume
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (63 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 64/92] xen/events: Clear cpu_evtchn_mask before resuming Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 66/92] xen/console: Update console " Kamal Mostafa
` (26 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Boris Ostrovsky, David Vrabel, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
commit 16f1cf3ba7303228372d3756677bf7d10e79cf9f upstream.
After a resume the hypervisor/tools may change xenbus event
channel number. We should re-query it.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/xen/xenbus/xenbus_probe.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 564b315..5390a67 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -57,6 +57,7 @@
#include <xen/xen.h>
#include <xen/xenbus.h>
#include <xen/events.h>
+#include <xen/xen-ops.h>
#include <xen/page.h>
#include <xen/hvm.h>
@@ -735,6 +736,30 @@ static int __init xenstored_local_init(void)
return err;
}
+static int xenbus_resume_cb(struct notifier_block *nb,
+ unsigned long action, void *data)
+{
+ int err = 0;
+
+ if (xen_hvm_domain()) {
+ uint64_t v;
+
+ err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
+ if (!err && v)
+ xen_store_evtchn = v;
+ else
+ pr_warn("Cannot update xenstore event channel: %d\n",
+ err);
+ } else
+ xen_store_evtchn = xen_start_info->store_evtchn;
+
+ return err;
+}
+
+static struct notifier_block xenbus_resume_nb = {
+ .notifier_call = xenbus_resume_cb,
+};
+
static int __init xenbus_init(void)
{
int err = 0;
@@ -793,6 +818,10 @@ static int __init xenbus_init(void)
goto out_error;
}
+ if ((xen_store_domain_type != XS_LOCAL) &&
+ (xen_store_domain_type != XS_UNKNOWN))
+ xen_resume_notifier_register(&xenbus_resume_nb);
+
#ifdef CONFIG_XEN_COMPAT_XENFS
/*
* Create xenfs mountpoint in /proc for compatibility with
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 66/92] xen/console: Update console event channel on resume
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (64 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 65/92] xen/xenbus: Update xenbus event channel on resume Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 67/92] xen/events: Set irq_info->evtchn before binding the channel to CPU in __startup_pirq() Kamal Mostafa
` (25 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Boris Ostrovsky, David Vrabel, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
commit b9d934f27c91b878c4b2e64299d6e419a4022f8d upstream.
After a resume the hypervisor/tools may change console event
channel number. We should re-query it.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/tty/hvc/hvc_xen.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index f1e5742..5bab1c6 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -299,11 +299,27 @@ static int xen_initial_domain_console_init(void)
return 0;
}
+static void xen_console_update_evtchn(struct xencons_info *info)
+{
+ if (xen_hvm_domain()) {
+ uint64_t v;
+ int err;
+
+ err = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v);
+ if (!err && v)
+ info->evtchn = v;
+ } else
+ info->evtchn = xen_start_info->console.domU.evtchn;
+}
+
void xen_console_resume(void)
{
struct xencons_info *info = vtermno_to_xencons(HVC_COOKIE);
- if (info != NULL && info->irq)
+ if (info != NULL && info->irq) {
+ if (!xen_initial_domain())
+ xen_console_update_evtchn(info);
rebind_evtchn_irq(info->evtchn, info->irq);
+ }
}
static void xencons_disconnect_backend(struct xencons_info *info)
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 67/92] xen/events: Set irq_info->evtchn before binding the channel to CPU in __startup_pirq()
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (65 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 66/92] xen/console: Update console " Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 68/92] mm/memory-failure: call shake_page() when error hits thp tail page Kamal Mostafa
` (24 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Boris Ostrovsky, David Vrabel, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
commit 16e6bd5970c88a2ac018b84a5f1dd5c2ff1fdf2c upstream.
.. because bind_evtchn_to_cpu(evtchn, cpu) will map evtchn to
'info' and pass 'info' down to xen_evtchn_port_bind_to_cpu().
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Tested-by: Annie Li <annie.li@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/xen/events/events_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index a1ec564..2b8553b 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -529,8 +529,8 @@ static unsigned int __startup_pirq(unsigned int irq)
if (rc)
goto err;
- bind_evtchn_to_cpu(evtchn, 0);
info->evtchn = evtchn;
+ bind_evtchn_to_cpu(evtchn, 0);
rc = xen_evtchn_port_setup(info);
if (rc)
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 68/92] mm/memory-failure: call shake_page() when error hits thp tail page
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (66 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 67/92] xen/events: Set irq_info->evtchn before binding the channel to CPU in __startup_pirq() Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 69/92] mm: soft-offline: fix num_poisoned_pages counting on concurrent events Kamal Mostafa
` (23 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Naoya Horiguchi, Andrea Arcangeli, Hidetoshi Seto, Jin Dongming,
Andrew Morton, Linus Torvalds, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
commit 09789e5de18e4e442870b2d700831f5cb802eb05 upstream.
Currently memory_failure() calls shake_page() to sweep pages out from
pcplists only when the victim page is 4kB LRU page or thp head page.
But we should do this for a thp tail page too.
Consider that a memory error hits a thp tail page whose head page is on
a pcplist when memory_failure() runs. Then, the current kernel skips
shake_pages() part, so hwpoison_user_mappings() returns without calling
split_huge_page() nor try_to_unmap() because PageLRU of the thp head is
still cleared due to the skip of shake_page().
As a result, me_huge_page() runs for the thp, which is broken behavior.
One effect is a leak of the thp. And another is to fail to isolate the
memory error, so later access to the error address causes another MCE,
which kills the processes which used the thp.
This patch fixes this problem by calling shake_page() for thp tail case.
Fixes: 385de35722c9 ("thp: allow a hwpoisoned head page to be put back to LRU")
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Dean Nelson <dnelson@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Jin Dongming <jin.dongming@np.css.fujitsu.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>
---
mm/memory-failure.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 20c29dd..5e71ba3 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1148,10 +1148,10 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
* The check (unnecessarily) ignores LRU pages being isolated and
* walked by the page reclaim code, however that's not a big loss.
*/
- if (!PageHuge(p) && !PageTransTail(p)) {
- if (!PageLRU(p))
- shake_page(p, 0);
- if (!PageLRU(p)) {
+ if (!PageHuge(p)) {
+ if (!PageLRU(hpage))
+ shake_page(hpage, 0);
+ if (!PageLRU(hpage)) {
/*
* shake_page could have turned it free.
*/
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 69/92] mm: soft-offline: fix num_poisoned_pages counting on concurrent events
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (67 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 68/92] mm/memory-failure: call shake_page() when error hits thp tail page Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 70/92] nilfs2: fix sanity check of btree level in nilfs_btree_root_broken() Kamal Mostafa
` (22 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Naoya Horiguchi, Andi Kleen, Andrew Morton, Linus Torvalds,
Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
commit 602498f9aa43d4951eece3fd6ad95a6d0a78d537 upstream.
If multiple soft offline events hit one free page/hugepage concurrently,
soft_offline_page() can handle the free page/hugepage multiple times,
which makes num_poisoned_pages counter increased more than once. This
patch fixes this wrong counting by checking TestSetPageHWPoison for normal
papes and by checking the return value of dequeue_hwpoisoned_huge_page()
for hugepages.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Dean Nelson <dnelson@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
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>
---
mm/memory-failure.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 5e71ba3..dc29bec 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1728,12 +1728,12 @@ int soft_offline_page(struct page *page, int flags)
} else if (ret == 0) { /* for free pages */
if (PageHuge(page)) {
set_page_hwpoison_huge_page(hpage);
- dequeue_hwpoisoned_huge_page(hpage);
- atomic_long_add(1 << compound_order(hpage),
+ if (!dequeue_hwpoisoned_huge_page(hpage))
+ atomic_long_add(1 << compound_order(hpage),
&num_poisoned_pages);
} else {
- SetPageHWPoison(page);
- atomic_long_inc(&num_poisoned_pages);
+ if (!TestSetPageHWPoison(page))
+ atomic_long_inc(&num_poisoned_pages);
}
}
unset_migratetype_isolate(page, MIGRATE_MOVABLE);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 70/92] nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (68 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 69/92] mm: soft-offline: fix num_poisoned_pages counting on concurrent events Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 71/92] ocfs2: dlm: fix race between purge and get lock resource Kamal Mostafa
` (21 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ryusuke Konishi, Andrew Morton, Linus Torvalds, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
commit d8fd150fe3935e1692bf57c66691e17409ebb9c1 upstream.
The range check for b-tree level parameter in nilfs_btree_root_broken()
is wrong; it accepts the case of "level == NILFS_BTREE_LEVEL_MAX" even
though the level is limited to values in the range of 0 to
(NILFS_BTREE_LEVEL_MAX - 1).
Since the level parameter is read from storage device and used to index
nilfs_btree_path array whose element count is NILFS_BTREE_LEVEL_MAX, it
can cause memory overrun during btree operations if the boundary value
is set to the level parameter on device.
This fixes the broken sanity check and adds a comment to clarify that
the upper bound NILFS_BTREE_LEVEL_MAX is exclusive.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nilfs2/btree.c | 2 +-
include/linux/nilfs2_fs.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c
index ecdbae1..090d8ce 100644
--- a/fs/nilfs2/btree.c
+++ b/fs/nilfs2/btree.c
@@ -388,7 +388,7 @@ static int nilfs_btree_root_broken(const struct nilfs_btree_node *node,
nchildren = nilfs_btree_node_get_nchildren(node);
if (unlikely(level < NILFS_BTREE_LEVEL_NODE_MIN ||
- level > NILFS_BTREE_LEVEL_MAX ||
+ level >= NILFS_BTREE_LEVEL_MAX ||
nchildren < 0 ||
nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX)) {
pr_crit("NILFS: bad btree root (inode number=%lu): level = %d, flags = 0x%x, nchildren = %d\n",
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h
index ff3fea3..9abb763 100644
--- a/include/linux/nilfs2_fs.h
+++ b/include/linux/nilfs2_fs.h
@@ -460,7 +460,7 @@ struct nilfs_btree_node {
/* level */
#define NILFS_BTREE_LEVEL_DATA 0
#define NILFS_BTREE_LEVEL_NODE_MIN (NILFS_BTREE_LEVEL_DATA + 1)
-#define NILFS_BTREE_LEVEL_MAX 14
+#define NILFS_BTREE_LEVEL_MAX 14 /* Max level (exclusive) */
/**
* struct nilfs_palloc_group_desc - block group descriptor
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 71/92] ocfs2: dlm: fix race between purge and get lock resource
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (69 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 70/92] nilfs2: fix sanity check of btree level in nilfs_btree_root_broken() Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 72/92] drm/i915/dp: there is no audio on port A Kamal Mostafa
` (20 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Junxiao Bi, Joseph Qi, Mark Fasheh, Joel Becker, Andrew Morton,
Linus Torvalds, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxiao Bi <junxiao.bi@oracle.com>
commit b1432a2a35565f538586774a03bf277c27fc267d upstream.
There is a race window in dlm_get_lock_resource(), which may return a
lock resource which has been purged. This will cause the process to
hang forever in dlmlock() as the ast msg can't be handled due to its
lock resource not existing.
dlm_get_lock_resource {
...
spin_lock(&dlm->spinlock);
tmpres = __dlm_lookup_lockres_full(dlm, lockid, namelen, hash);
if (tmpres) {
spin_unlock(&dlm->spinlock);
>>>>>>>> race window, dlm_run_purge_list() may run and purge
the lock resource
spin_lock(&tmpres->spinlock);
...
spin_unlock(&tmpres->spinlock);
}
}
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
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>
---
fs/ocfs2/dlm/dlmmaster.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index a6944b2..fdf4b41 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -757,6 +757,19 @@ lookup:
if (tmpres) {
spin_unlock(&dlm->spinlock);
spin_lock(&tmpres->spinlock);
+
+ /*
+ * Right after dlm spinlock was released, dlm_thread could have
+ * purged the lockres. Check if lockres got unhashed. If so
+ * start over.
+ */
+ if (hlist_unhashed(&tmpres->hash_node)) {
+ spin_unlock(&tmpres->spinlock);
+ dlm_lockres_put(tmpres);
+ tmpres = NULL;
+ goto lookup;
+ }
+
/* Wait on the thread that is mastering the resource */
if (tmpres->owner == DLM_LOCK_RES_OWNER_UNKNOWN) {
__dlm_wait_on_lockres(tmpres);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 72/92] drm/i915/dp: there is no audio on port A
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (70 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 71/92] ocfs2: dlm: fix race between purge and get lock resource Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 73/92] drm/amdkfd: allow unregister process with queues Kamal Mostafa
` (19 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Jani Nikula, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <jani.nikula@intel.com>
commit 9fcb1704d1d51b12e2f03c78bca013d0cbbb7c98 upstream.
The eDP port A register on PCH split platforms has a slightly different
register layout from the other ports, with bit 6 being either alternate
scrambler reset or reserved, depending on the generation. Our
misinterpretation of the bit as audio has lead to warning.
Fix this by not enabling audio on port A, since none of our platforms
support audio on port A anyway.
v2: DDI doesn't have audio on port A either (Sivakumar Thulasimani)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89958
Reported-and-tested-by: Chris Bainbridge <chris.bainbridge@gmail.com>
Reviewed-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/i915/intel_dp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 9f6c897..00c8ee9 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1175,7 +1175,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
pipe_config->has_dp_encoder = true;
pipe_config->has_drrs = false;
- pipe_config->has_audio = intel_dp->has_audio;
+ pipe_config->has_audio = intel_dp->has_audio && port != PORT_A;
if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
@@ -2024,8 +2024,8 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
int dotclock;
tmp = I915_READ(intel_dp->output_reg);
- if (tmp & DP_AUDIO_OUTPUT_ENABLE)
- pipe_config->has_audio = true;
+
+ pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
if ((port == PORT_A) || !HAS_PCH_CPT(dev)) {
if (tmp & DP_SYNC_HS_HIGH)
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 73/92] drm/amdkfd: allow unregister process with queues
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (71 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 72/92] drm/i915/dp: there is no audio on port A Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 74/92] drm/radeon: fix userptr BO unpin bug v3 Kamal Mostafa
` (18 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Oded Gabbay, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Oded Gabbay <oded.gabbay@gmail.com>
commit 1e5ec956a057585adaa1365615c82810b2f5356f upstream.
Sometimes we might unregister process that have queues, because we couldn't
preempt the queues. Until now we blocked it with BUG_ON but instead just
print it as debug.
Reviewed-by: Ben Goz <ben.goz@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index c80a8a3..c9d2f3a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -445,9 +445,10 @@ static int unregister_process_nocpsch(struct device_queue_manager *dqm,
BUG_ON(!dqm || !qpd);
- BUG_ON(!list_empty(&qpd->queues_list));
+ pr_debug("In func %s\n", __func__);
- pr_debug("kfd: In func %s\n", __func__);
+ pr_debug("qpd->queues_list is %s\n",
+ list_empty(&qpd->queues_list) ? "empty" : "not empty");
retval = 0;
mutex_lock(&dqm->lock);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 74/92] drm/radeon: fix userptr BO unpin bug v3
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (72 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 73/92] drm/amdkfd: allow unregister process with queues Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 75/92] drm/radeon: make VCE handle check more strict Kamal Mostafa
` (17 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: monk.liu, Christian König, Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "monk.liu" <monk.liu@amd.com>
commit db12973cd581d4e79f4aadd0960948f268d15af7 upstream.
Fixing a memory leak with userptrs.
v2: clean up the loop, use an iterator instead
v3: remove unused variable
Signed-off-by: monk.liu <monk.liu@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_ttm.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index b292aca..edafd3c 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -591,8 +591,7 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
{
struct radeon_device *rdev = radeon_get_rdev(ttm->bdev);
struct radeon_ttm_tt *gtt = (void *)ttm;
- struct scatterlist *sg;
- int i;
+ struct sg_page_iter sg_iter;
int write = !(gtt->userflags & RADEON_GEM_USERPTR_READONLY);
enum dma_data_direction direction = write ?
@@ -605,9 +604,8 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
/* free the sg table and pages again */
dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
- for_each_sg(ttm->sg->sgl, sg, ttm->sg->nents, i) {
- struct page *page = sg_page(sg);
-
+ for_each_sg_page(ttm->sg->sgl, &sg_iter, ttm->sg->nents, 0) {
+ struct page *page = sg_page_iter_page(&sg_iter);
if (!(gtt->userflags & RADEON_GEM_USERPTR_READONLY))
set_page_dirty(page);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 75/92] drm/radeon: make VCE handle check more strict
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (73 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 74/92] drm/radeon: fix userptr BO unpin bug v3 Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 76/92] drm/radeon: make UVD handle checking " Kamal Mostafa
` (16 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christian König, Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
commit 29c63fe22a17c64e54016040cd882481bd45ee5a upstream.
Invalid handles can crash the hw.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_vce.c | 65 +++++++++++++++++++++++++++----------
1 file changed, 48 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_vce.c b/drivers/gpu/drm/radeon/radeon_vce.c
index 976fe43..7ed5612 100644
--- a/drivers/gpu/drm/radeon/radeon_vce.c
+++ b/drivers/gpu/drm/radeon/radeon_vce.c
@@ -493,18 +493,27 @@ int radeon_vce_cs_reloc(struct radeon_cs_parser *p, int lo, int hi,
*
* @p: parser context
* @handle: handle to validate
+ * @allocated: allocated a new handle?
*
* Validates the handle and return the found session index or -EINVAL
* we we don't have another free session index.
*/
-int radeon_vce_validate_handle(struct radeon_cs_parser *p, uint32_t handle)
+static int radeon_vce_validate_handle(struct radeon_cs_parser *p,
+ uint32_t handle, bool *allocated)
{
unsigned i;
+ *allocated = false;
+
/* validate the handle */
for (i = 0; i < RADEON_MAX_VCE_HANDLES; ++i) {
- if (atomic_read(&p->rdev->vce.handles[i]) == handle)
+ if (atomic_read(&p->rdev->vce.handles[i]) == handle) {
+ if (p->rdev->vce.filp[i] != p->filp) {
+ DRM_ERROR("VCE handle collision detected!\n");
+ return -EINVAL;
+ }
return i;
+ }
}
/* handle not found try to alloc a new one */
@@ -512,6 +521,7 @@ int radeon_vce_validate_handle(struct radeon_cs_parser *p, uint32_t handle)
if (!atomic_cmpxchg(&p->rdev->vce.handles[i], 0, handle)) {
p->rdev->vce.filp[i] = p->filp;
p->rdev->vce.img_size[i] = 0;
+ *allocated = true;
return i;
}
}
@@ -529,10 +539,10 @@ int radeon_vce_validate_handle(struct radeon_cs_parser *p, uint32_t handle)
int radeon_vce_cs_parse(struct radeon_cs_parser *p)
{
int session_idx = -1;
- bool destroyed = false;
+ bool destroyed = false, created = false, allocated = false;
uint32_t tmp, handle = 0;
uint32_t *size = &tmp;
- int i, r;
+ int i, r = 0;
while (p->idx < p->chunk_ib->length_dw) {
uint32_t len = radeon_get_ib_value(p, p->idx);
@@ -540,18 +550,21 @@ int radeon_vce_cs_parse(struct radeon_cs_parser *p)
if ((len < 8) || (len & 3)) {
DRM_ERROR("invalid VCE command length (%d)!\n", len);
- return -EINVAL;
+ r = -EINVAL;
+ goto out;
}
if (destroyed) {
DRM_ERROR("No other command allowed after destroy!\n");
- return -EINVAL;
+ r = -EINVAL;
+ goto out;
}
switch (cmd) {
case 0x00000001: // session
handle = radeon_get_ib_value(p, p->idx + 2);
- session_idx = radeon_vce_validate_handle(p, handle);
+ session_idx = radeon_vce_validate_handle(p, handle,
+ &allocated);
if (session_idx < 0)
return session_idx;
size = &p->rdev->vce.img_size[session_idx];
@@ -561,6 +574,13 @@ int radeon_vce_cs_parse(struct radeon_cs_parser *p)
break;
case 0x01000001: // create
+ created = true;
+ if (!allocated) {
+ DRM_ERROR("Handle already in use!\n");
+ r = -EINVAL;
+ goto out;
+ }
+
*size = radeon_get_ib_value(p, p->idx + 8) *
radeon_get_ib_value(p, p->idx + 10) *
8 * 3 / 2;
@@ -577,12 +597,12 @@ int radeon_vce_cs_parse(struct radeon_cs_parser *p)
r = radeon_vce_cs_reloc(p, p->idx + 10, p->idx + 9,
*size);
if (r)
- return r;
+ goto out;
r = radeon_vce_cs_reloc(p, p->idx + 12, p->idx + 11,
*size / 3);
if (r)
- return r;
+ goto out;
break;
case 0x02000001: // destroy
@@ -593,7 +613,7 @@ int radeon_vce_cs_parse(struct radeon_cs_parser *p)
r = radeon_vce_cs_reloc(p, p->idx + 3, p->idx + 2,
*size * 2);
if (r)
- return r;
+ goto out;
break;
case 0x05000004: // video bitstream buffer
@@ -601,36 +621,47 @@ int radeon_vce_cs_parse(struct radeon_cs_parser *p)
r = radeon_vce_cs_reloc(p, p->idx + 3, p->idx + 2,
tmp);
if (r)
- return r;
+ goto out;
break;
case 0x05000005: // feedback buffer
r = radeon_vce_cs_reloc(p, p->idx + 3, p->idx + 2,
4096);
if (r)
- return r;
+ goto out;
break;
default:
DRM_ERROR("invalid VCE command (0x%x)!\n", cmd);
- return -EINVAL;
+ r = -EINVAL;
+ goto out;
}
if (session_idx == -1) {
DRM_ERROR("no session command at start of IB\n");
- return -EINVAL;
+ r = -EINVAL;
+ goto out;
}
p->idx += len / 4;
}
- if (destroyed) {
- /* IB contains a destroy msg, free the handle */
+ if (allocated && !created) {
+ DRM_ERROR("New session without create command!\n");
+ r = -ENOENT;
+ }
+
+out:
+ if ((!r && destroyed) || (r && allocated)) {
+ /*
+ * IB contains a destroy msg or we have allocated an
+ * handle and got an error, anyway free the handle
+ */
for (i = 0; i < RADEON_MAX_VCE_HANDLES; ++i)
atomic_cmpxchg(&p->rdev->vce.handles[i], handle, 0);
}
- return 0;
+ return r;
}
/**
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 76/92] drm/radeon: make UVD handle checking more strict
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (74 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 75/92] drm/radeon: make VCE handle check more strict Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 77/92] drm/radeon: more strictly validate the UVD codec Kamal Mostafa
` (15 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christian König, Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
commit a1b403da70e038ca6c6c6fe434d1d873546873a3 upstream.
Invalid messages can crash the hw otherwise.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_uvd.c | 72 ++++++++++++++++++++++---------------
1 file changed, 43 insertions(+), 29 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
index c10b2ae..f67a6aa 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -436,50 +436,64 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
return -EINVAL;
}
- if (msg_type == 1) {
+ switch (msg_type) {
+ case 0:
+ /* it's a create msg, calc image size (width * height) */
+ img_size = msg[7] * msg[8];
+ radeon_bo_kunmap(bo);
+
+ /* try to alloc a new handle */
+ for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) {
+ if (atomic_read(&p->rdev->uvd.handles[i]) == handle) {
+ DRM_ERROR("Handle 0x%x already in use!\n", handle);
+ return -EINVAL;
+ }
+
+ if (!atomic_cmpxchg(&p->rdev->uvd.handles[i], 0, handle)) {
+ p->rdev->uvd.filp[i] = p->filp;
+ p->rdev->uvd.img_size[i] = img_size;
+ return 0;
+ }
+ }
+
+ DRM_ERROR("No more free UVD handles!\n");
+ return -EINVAL;
+
+ case 1:
/* it's a decode msg, calc buffer sizes */
r = radeon_uvd_cs_msg_decode(msg, buf_sizes);
- /* calc image size (width * height) */
- img_size = msg[6] * msg[7];
radeon_bo_kunmap(bo);
if (r)
return r;
- } else if (msg_type == 2) {
+ /* validate the handle */
+ for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) {
+ if (atomic_read(&p->rdev->uvd.handles[i]) == handle) {
+ if (p->rdev->uvd.filp[i] != p->filp) {
+ DRM_ERROR("UVD handle collision detected!\n");
+ return -EINVAL;
+ }
+ return 0;
+ }
+ }
+
+ DRM_ERROR("Invalid UVD handle 0x%x!\n", handle);
+ return -ENOENT;
+
+ case 2:
/* it's a destroy msg, free the handle */
for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i)
atomic_cmpxchg(&p->rdev->uvd.handles[i], handle, 0);
radeon_bo_kunmap(bo);
return 0;
- } else {
- /* it's a create msg, calc image size (width * height) */
- img_size = msg[7] * msg[8];
- radeon_bo_kunmap(bo);
- if (msg_type != 0) {
- DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
- return -EINVAL;
- }
-
- /* it's a create msg, no special handling needed */
- }
-
- /* create or decode, validate the handle */
- for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) {
- if (atomic_read(&p->rdev->uvd.handles[i]) == handle)
- return 0;
- }
+ default:
- /* handle not found try to alloc a new one */
- for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) {
- if (!atomic_cmpxchg(&p->rdev->uvd.handles[i], 0, handle)) {
- p->rdev->uvd.filp[i] = p->filp;
- p->rdev->uvd.img_size[i] = img_size;
- return 0;
- }
+ DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
+ return -EINVAL;
}
- DRM_ERROR("No more free UVD handles!\n");
+ BUG();
return -EINVAL;
}
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 77/92] drm/radeon: more strictly validate the UVD codec
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (75 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 76/92] drm/radeon: make UVD handle checking " Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 78/92] path_openat(): fix double fput() Kamal Mostafa
` (14 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Christian König, Alex Deucher, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
commit d52cdfa4a0c6406bbfb33206341eaf1fb1555994 upstream.
MPEG 2/4 are only supported since UVD3.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/radeon/radeon_uvd.c | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
index f67a6aa..cd63028 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -396,6 +396,29 @@ static int radeon_uvd_cs_msg_decode(uint32_t *msg, unsigned buf_sizes[])
return 0;
}
+static int radeon_uvd_validate_codec(struct radeon_cs_parser *p,
+ unsigned stream_type)
+{
+ switch (stream_type) {
+ case 0: /* H264 */
+ case 1: /* VC1 */
+ /* always supported */
+ return 0;
+
+ case 3: /* MPEG2 */
+ case 4: /* MPEG4 */
+ /* only since UVD 3 */
+ if (p->rdev->family >= CHIP_PALM)
+ return 0;
+
+ /* fall through */
+ default:
+ DRM_ERROR("UVD codec not supported by hardware %d!\n",
+ stream_type);
+ return -EINVAL;
+ }
+}
+
static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
unsigned offset, unsigned buf_sizes[])
{
@@ -440,7 +463,11 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
case 0:
/* it's a create msg, calc image size (width * height) */
img_size = msg[7] * msg[8];
+
+ r = radeon_uvd_validate_codec(p, msg[4]);
radeon_bo_kunmap(bo);
+ if (r)
+ return r;
/* try to alloc a new handle */
for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) {
@@ -460,8 +487,10 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
return -EINVAL;
case 1:
- /* it's a decode msg, calc buffer sizes */
- r = radeon_uvd_cs_msg_decode(msg, buf_sizes);
+ /* it's a decode msg, validate codec and calc buffer sizes */
+ r = radeon_uvd_validate_codec(p, msg[4]);
+ if (!r)
+ r = radeon_uvd_cs_msg_decode(msg, buf_sizes);
radeon_bo_kunmap(bo);
if (r)
return r;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 78/92] path_openat(): fix double fput()
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (76 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 77/92] drm/radeon: more strictly validate the UVD codec Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 79/92] mnt: Fix fs_fully_visible to verify the root directory is visible Kamal Mostafa
` (13 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Al Viro, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <viro@zeniv.linux.org.uk>
commit f15133df088ecadd141ea1907f2c96df67c729f0 upstream.
path_openat() jumps to the wrong place after do_tmpfile() - it has
already done path_cleanup() (as part of path_lookupat() called by
do_tmpfile()), so doing that again can lead to double fput().
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/namei.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/namei.c b/fs/namei.c
index 3abfbda..b4d2182 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3209,7 +3209,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
if (unlikely(file->f_flags & __O_TMPFILE)) {
error = do_tmpfile(dfd, pathname, nd, flags, op, file, &opened);
- goto out;
+ goto out2;
}
error = path_init(dfd, pathname->name, flags, nd);
@@ -3239,6 +3239,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
}
out:
path_cleanup(nd);
+out2:
if (!(opened & FILE_OPENED)) {
BUG_ON(!error);
put_filp(file);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 79/92] mnt: Fix fs_fully_visible to verify the root directory is visible
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (77 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 78/92] path_openat(): fix double fput() Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 80/92] drm: Zero out invalid vblank timestamp in drm_update_vblank_count Kamal Mostafa
` (12 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Eric W. Biederman, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: "Eric W. Biederman" <ebiederm@xmission.com>
commit 7e96c1b0e0f495c5a7450dc4aa7c9a24ba4305bd upstream.
This fixes a dumb bug in fs_fully_visible that allows proc or sys to
be mounted if there is a bind mount of part of /proc/ or /sys/ visible.
Reported-by: Eric Windisch <ewindisch@docker.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/namespace.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/namespace.c b/fs/namespace.c
index 07d0562..8129c51 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3140,6 +3140,12 @@ bool fs_fully_visible(struct file_system_type *type)
if (mnt->mnt.mnt_sb->s_type != type)
continue;
+ /* This mount is not fully visible if it's root directory
+ * is not the root directory of the filesystem.
+ */
+ if (mnt->mnt.mnt_root != mnt->mnt.mnt_sb->s_root)
+ continue;
+
/* This mount is not fully visible if there are any child mounts
* that cover anything except for empty directories.
*/
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 80/92] drm: Zero out invalid vblank timestamp in drm_update_vblank_count.
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (78 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 79/92] mnt: Fix fs_fully_visible to verify the root directory is visible Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 81/92] ARM: ux500: Move GPIO regulator for SD-card into board DTSs Kamal Mostafa
` (11 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Mario Kleiner, Ville Syrjälä,
Daniel Vetter, Dave Airlie, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Kleiner <mario.kleiner.de@gmail.com>
commit fdb68e09bbb1c981f24608d7022c7d93cc47b326 upstream.
Since commit 844b03f27739135fe1fed2fef06da0ffc4c7a081 we make
sure that after vblank irq off, we return the last valid
(vblank count, vblank timestamp) pair to clients, e.g., during
modesets, which is good.
An overlooked side effect of that commit for kms drivers without
support for precise vblank timestamping is that at vblank irq
enable, when we update the vblank counter from the hw counter, we
can't update the corresponding vblank timestamp, so now we have a
totally mismatched timestamp for the new count to confuse clients.
Restore old client visible behaviour from before Linux 3.17, but
zero out the timestamp at vblank counter update (instead of disable
as in original implementation) if we can't generate a meaningful
timestamp immediately for the new vblank counter. This will fix
this regression, so callers know they need to retry again later
if they need a valid timestamp, but at the same time preserves
the improvements made in the commit mentioned above.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/gpu/drm/drm_irq.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 4d79dad..68193a6 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -131,12 +131,11 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc)
/* Reinitialize corresponding vblank timestamp if high-precision query
* available. Skip this step if query unsupported or failed. Will
- * reinitialize delayed at next vblank interrupt in that case.
+ * reinitialize delayed at next vblank interrupt in that case and
+ * assign 0 for now, to mark the vblanktimestamp as invalid.
*/
- if (rc) {
- tslot = atomic_read(&vblank->count) + diff;
- vblanktimestamp(dev, crtc, tslot) = t_vblank;
- }
+ tslot = atomic_read(&vblank->count) + diff;
+ vblanktimestamp(dev, crtc, tslot) = rc ? t_vblank : (struct timeval) {0, 0};
smp_mb__before_atomic();
atomic_add(diff, &vblank->count);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 81/92] ARM: ux500: Move GPIO regulator for SD-card into board DTSs
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (79 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 80/92] drm: Zero out invalid vblank timestamp in drm_update_vblank_count Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 82/92] ARM: ux500: Enable GPIO regulator for SD-card for HREF boards Kamal Mostafa
` (10 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ulf Hansson, Linus Walleij, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ulf Hansson <ulf.hansson@linaro.org>
commit 53d2669844263fd5fdc70f0eb6a2eb8a21086d8e upstream.
The GPIO regulator for the SD-card isn't a ux500 SOC configuration, but
instead it's specific to the board. Move the definition of it, into the
board DTSs.
Fixes: c94a4ab7af3f ("ARM: ux500: Disable the MMCI gpio-regulator by default")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/ste-dbx5x0.dtsi | 17 -----------------
arch/arm/boot/dts/ste-href.dtsi | 17 +++++++++++++++++
arch/arm/boot/dts/ste-snowball.dts | 15 +++++++++++++++
3 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi
index bfd3f1c..2201cd5 100644
--- a/arch/arm/boot/dts/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi
@@ -1017,23 +1017,6 @@
status = "disabled";
};
- vmmci: regulator-gpio {
- compatible = "regulator-gpio";
-
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <2900000>;
- regulator-name = "mmci-reg";
- regulator-type = "voltage";
-
- startup-delay-us = <100>;
- enable-active-high;
-
- states = <1800000 0x1
- 2900000 0x0>;
-
- status = "disabled";
- };
-
mcde@a0350000 {
compatible = "stericsson,mcde";
reg = <0xa0350000 0x1000>, /* MCDE */
diff --git a/arch/arm/boot/dts/ste-href.dtsi b/arch/arm/boot/dts/ste-href.dtsi
index bf8f0ed..8cf499a 100644
--- a/arch/arm/boot/dts/ste-href.dtsi
+++ b/arch/arm/boot/dts/ste-href.dtsi
@@ -111,6 +111,23 @@
pinctrl-1 = <&i2c3_sleep_mode>;
};
+ vmmci: regulator-gpio {
+ compatible = "regulator-gpio";
+
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <2900000>;
+ regulator-name = "mmci-reg";
+ regulator-type = "voltage";
+
+ startup-delay-us = <100>;
+ enable-active-high;
+
+ states = <1800000 0x1
+ 2900000 0x0>;
+
+ status = "disabled";
+ };
+
// External Micro SD slot
sdi0_per1@80126000 {
arm,primecell-periphid = <0x10480180>;
diff --git a/arch/arm/boot/dts/ste-snowball.dts b/arch/arm/boot/dts/ste-snowball.dts
index 206826a..65a7f63 100644
--- a/arch/arm/boot/dts/ste-snowball.dts
+++ b/arch/arm/boot/dts/ste-snowball.dts
@@ -146,8 +146,23 @@
};
vmmci: regulator-gpio {
+ compatible = "regulator-gpio";
+
gpios = <&gpio7 4 0x4>;
enable-gpio = <&gpio6 25 0x4>;
+
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <2900000>;
+ regulator-name = "mmci-reg";
+ regulator-type = "voltage";
+
+ startup-delay-us = <100>;
+ enable-active-high;
+
+ states = <1800000 0x1
+ 2900000 0x0>;
+
+ status = "disabled";
};
// External Micro SD slot
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 82/92] ARM: ux500: Enable GPIO regulator for SD-card for HREF boards
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (80 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 81/92] ARM: ux500: Move GPIO regulator for SD-card into board DTSs Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 83/92] ARM: ux500: Enable GPIO regulator for SD-card for snowball Kamal Mostafa
` (9 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ulf Hansson, Linus Walleij, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ulf Hansson <ulf.hansson@linaro.org>
commit f9a8c3914ba85f19c3360b19612d77c47adb8942 upstream.
Fixes: c94a4ab7af3f ("ARM: ux500: Disable the MMCI gpio-regulator by default")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/ste-href.dtsi | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm/boot/dts/ste-href.dtsi b/arch/arm/boot/dts/ste-href.dtsi
index 8cf499a..744c1e3 100644
--- a/arch/arm/boot/dts/ste-href.dtsi
+++ b/arch/arm/boot/dts/ste-href.dtsi
@@ -124,8 +124,6 @@
states = <1800000 0x1
2900000 0x0>;
-
- status = "disabled";
};
// External Micro SD slot
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 83/92] ARM: ux500: Enable GPIO regulator for SD-card for snowball
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (81 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 82/92] ARM: ux500: Enable GPIO regulator for SD-card for HREF boards Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 84/92] xen-pciback: Add name prefix to global 'permissive' variable Kamal Mostafa
` (8 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ulf Hansson, Linus Walleij, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ulf Hansson <ulf.hansson@linaro.org>
commit 11133db7a836b0cb411faa048f07a38e994d1382 upstream.
Fixes: c94a4ab7af3f ("ARM: ux500: Disable the MMCI gpio-regulator by default")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/ste-snowball.dts | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm/boot/dts/ste-snowball.dts b/arch/arm/boot/dts/ste-snowball.dts
index 65a7f63..1bc84eb 100644
--- a/arch/arm/boot/dts/ste-snowball.dts
+++ b/arch/arm/boot/dts/ste-snowball.dts
@@ -161,8 +161,6 @@
states = <1800000 0x1
2900000 0x0>;
-
- status = "disabled";
};
// External Micro SD slot
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 84/92] xen-pciback: Add name prefix to global 'permissive' variable
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (82 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 83/92] ARM: ux500: Enable GPIO regulator for SD-card for snowball Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 85/92] mmc: core: add missing pm event in mmc_pm_notify to fix hib restore Kamal Mostafa
` (7 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Ben Hutchings, David Vrabel, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <ben@decadent.org.uk>
commit 8014bcc86ef112eab9ee1db312dba4e6b608cf89 upstream.
The variable for the 'permissive' module parameter used to be static
but was recently changed to be extern. This puts it in the kernel
global namespace if the driver is built-in, so its name should begin
with a prefix identifying the driver.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Fixes: af6fc858a35b ("xen-pciback: limit guest control of command register")
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/xen/xen-pciback/conf_space.c | 6 +++---
drivers/xen/xen-pciback/conf_space.h | 2 +-
| 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback/conf_space.c
index 75fe3d4..9c23420 100644
--- a/drivers/xen/xen-pciback/conf_space.c
+++ b/drivers/xen/xen-pciback/conf_space.c
@@ -16,8 +16,8 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-bool permissive;
-module_param(permissive, bool, 0644);
+bool xen_pcibk_permissive;
+module_param_named(permissive, xen_pcibk_permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word,
* xen_pcibk_write_config_word, and xen_pcibk_write_config_byte are created. */
@@ -262,7 +262,7 @@ int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value)
* This means that some fields may still be read-only because
* they have entries in the config_field list that intercept
* the write and do nothing. */
- if (dev_data->permissive || permissive) {
+ if (dev_data->permissive || xen_pcibk_permissive) {
switch (size) {
case 1:
err = pci_write_config_byte(dev, offset,
diff --git a/drivers/xen/xen-pciback/conf_space.h b/drivers/xen/xen-pciback/conf_space.h
index 2e1d73d..62461a8 100644
--- a/drivers/xen/xen-pciback/conf_space.h
+++ b/drivers/xen/xen-pciback/conf_space.h
@@ -64,7 +64,7 @@ struct config_field_entry {
void *data;
};
-extern bool permissive;
+extern bool xen_pcibk_permissive;
#define OFFSET(cfg_entry) ((cfg_entry)->base_offset+(cfg_entry)->field->offset)
--git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c
index 2d73693..f8baf46 100644
--- a/drivers/xen/xen-pciback/conf_space_header.c
+++ b/drivers/xen/xen-pciback/conf_space_header.c
@@ -105,7 +105,7 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)
cmd->val = value;
- if (!permissive && (!dev_data || !dev_data->permissive))
+ if (!xen_pcibk_permissive && (!dev_data || !dev_data->permissive))
return 0;
/* Only allow the guest to control certain bits. */
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 85/92] mmc: core: add missing pm event in mmc_pm_notify to fix hib restore
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (83 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 84/92] xen-pciback: Add name prefix to global 'permissive' variable Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 86/92] ARM: dts: am57xx-beagle-x15: Fix IRQ type for mcp7941x Kamal Mostafa
` (6 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Grygorii Strashko, Ulf Hansson, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Grygorii Strashko <Grygorii.Strashko@linaro.org>
commit 184af16b09360d6273fd6160e6ff7f8e2482ef23 upstream.
The PM_RESTORE_PREPARE is not handled now in mmc_pm_notify(),
as result mmc_rescan() could be scheduled and executed at
late hibernation restore stages when MMC device is suspended
already - which, in turn, will lead to system crash on TI dra7-evm board:
WARNING: CPU: 0 PID: 3188 at drivers/bus/omap_l3_noc.c:148 l3_interrupt_handler+0x258/0x374()
44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_PER1_P3 (Idle): Data Access in User mode during Functional access
Hence, add missed PM_RESTORE_PREPARE PM event in mmc_pm_notify().
Fixes: 4c2ef25fe0b8 (mmc: fix all hangs related to mmc/sd card...)
Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/core/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 9584bff..113aaec 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2620,6 +2620,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
switch (mode) {
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
+ case PM_RESTORE_PREPARE:
spin_lock_irqsave(&host->lock, flags);
host->rescan_disable = 1;
spin_unlock_irqrestore(&host->lock, flags);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 86/92] ARM: dts: am57xx-beagle-x15: Fix IRQ type for mcp7941x
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (84 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 85/92] mmc: core: add missing pm event in mmc_pm_notify to fix hib restore Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 87/92] mmc: sh_mmcif: Fix timeout value for command request Kamal Mostafa
` (5 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Grygorii Strashko, Nishanth Menon, Tony Lindgren, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Grygorii Strashko <Grygorii.Strashko@linaro.org>
commit e7a7357341664148cabf98a3ab50b5d449afca0b upstream.
The interrupt polarity provided in devicetree is used to configure
the interrupt controller(ARM GIC), however, it seems that we have an
inverter at the GIC boundary inside AM57xx which inverts the signal
input from sys_irq external interrupt source.
Further, as per GIC distributor TRM,
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0438d/BGBHIACJ.html#BABJFCFB
ARM GIC distributor does not support IRQ trigger type
IRQ_TYPE_LEVEL_LOW, and only rising or level high signals.
However, for some reason, the current configuration(which gets ignored
by GIC driver) functions on some platforms, however, on few platforms
results in infinite interrupts hogging the system down.
Switch over to rising edge for GIC configuration which is also aligned
with trigger point from the RTC chip and the internal inversion.
Fixes: 5a0f93c6576a ("ARM: dts: Add am57xx-beagle-x15")
Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm/boot/dts/am57xx-beagle-x15.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/am57xx-beagle-x15.dts b/arch/arm/boot/dts/am57xx-beagle-x15.dts
index 49edbda..bcc2f95 100644
--- a/arch/arm/boot/dts/am57xx-beagle-x15.dts
+++ b/arch/arm/boot/dts/am57xx-beagle-x15.dts
@@ -336,7 +336,7 @@
compatible = "microchip,mcp7941x";
reg = <0x6f>;
interrupt-parent = <&gic>;
- interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_LOW>; /* IRQ_SYS_1N */
+ interrupts = <GIC_SPI 2 IRQ_TYPE_EDGE_RISING>; /* IRQ_SYS_1N */
pinctrl-names = "default";
pinctrl-0 = <&mcp79410_pins_default>;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 87/92] mmc: sh_mmcif: Fix timeout value for command request
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (85 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 86/92] ARM: dts: am57xx-beagle-x15: Fix IRQ type for mcp7941x Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 88/92] mmc: card: Don't access RPMB partitions for normal read/write Kamal Mostafa
` (4 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Takeshi Kihara, Simon Horman, Yoshihiro Kaneko, Ulf Hansson,
Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Takeshi Kihara <takeshi.kihara.df@renesas.com>
commit bad4371d87d1d1ed1aecd9c9cc21c41ac3f289c8 upstream.
f9fd54f22e ("mmc: sh_mmcif: Use msecs_to_jiffies() for host->timeout")
changed the timeout value from 1000 jiffies to 1s. In the case where
HZ is 1000 the values are the same. However, for smaller HZ values the
timeout is now smaller, 1s instead of 10s in the case of HZ=100.
Since the timeout occurs in spite of a normal data transfer a timeout of
10s seems more appropriate. This restores the previous timeout in the
case where HZ=100 and results in an increase over the previous timeout
for larger values of HZ.
Fixes: f9fd54f22e ("mmc: sh_mmcif: Use msecs_to_jiffies() for host->timeout")
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
[horms: rewrote changelog to refer to HZ]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/host/sh_mmcif.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 7d9d6a3..5165ae7 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1402,7 +1402,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
host = mmc_priv(mmc);
host->mmc = mmc;
host->addr = reg;
- host->timeout = msecs_to_jiffies(1000);
+ host->timeout = msecs_to_jiffies(10000);
host->ccs_enable = !pd || !pd->ccs_unsupported;
host->clk_ctrl2_enable = pd && pd->clk_ctrl2_present;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 88/92] mmc: card: Don't access RPMB partitions for normal read/write
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (86 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 87/92] mmc: sh_mmcif: Fix timeout value for command request Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 89/92] pinctrl: Don't just pretend to protect pinctrl_maps, do it for real Kamal Mostafa
` (3 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Yunpeng Gao, Chuanxiao Dong, Ulf Hansson, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuanxiao Dong <chuanxiao.dong@intel.com>
commit 4e93b9a6abc0d028daf3c8a00cb77b679d8a4df4 upstream.
During kernel boot, it will try to read some logical sectors
of each block device node for the possible partition table.
But since RPMB partition is special and can not be accessed
by normal eMMC read / write CMDs, it will cause below error
messages during kernel boot:
...
mmc0: Got data interrupt 0x00000002 even though no data operation was in progress.
mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00
mmcblk0rpmb: retrying using single block read
mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900
end_request: I/O error, dev mmcblk0rpmb, sector 0
Buffer I/O error on device mmcblk0rpmb, logical block 0
end_request: I/O error, dev mmcblk0rpmb, sector 8
Buffer I/O error on device mmcblk0rpmb, logical block 1
end_request: I/O error, dev mmcblk0rpmb, sector 16
Buffer I/O error on device mmcblk0rpmb, logical block 2
end_request: I/O error, dev mmcblk0rpmb, sector 24
Buffer I/O error on device mmcblk0rpmb, logical block 3
...
This patch will discard the access request in eMMC queue if
it is RPMB partition access request. By this way, it avoids
trigger above error messages.
Fixes: 090d25fe224c ("mmc: core: Expose access to RPMB partition")
Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Tested-by: Michael Shigorin <mike@altlinux.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/mmc/card/block.c | 12 ++++++++++++
drivers/mmc/card/queue.c | 2 +-
drivers/mmc/card/queue.h | 2 ++
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 4409d79..4e5d36a 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1029,6 +1029,18 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type)
md->reset_done &= ~type;
}
+int mmc_access_rpmb(struct mmc_queue *mq)
+{
+ struct mmc_blk_data *md = mq->data;
+ /*
+ * If this is a RPMB partition access, return ture
+ */
+ if (md && md->part_type == EXT_CSD_PART_CONFIG_ACC_RPMB)
+ return true;
+
+ return false;
+}
+
static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
{
struct mmc_blk_data *md = mq->data;
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 236d194..8efa368 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -38,7 +38,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req)
return BLKPREP_KILL;
}
- if (mq && mmc_card_removed(mq->card))
+ if (mq && (mmc_card_removed(mq->card) || mmc_access_rpmb(mq)))
return BLKPREP_KILL;
req->cmd_flags |= REQ_DONTPREP;
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
index 5752d50..99e6521 100644
--- a/drivers/mmc/card/queue.h
+++ b/drivers/mmc/card/queue.h
@@ -73,4 +73,6 @@ extern void mmc_queue_bounce_post(struct mmc_queue_req *);
extern int mmc_packed_init(struct mmc_queue *, struct mmc_card *);
extern void mmc_packed_clean(struct mmc_queue *);
+extern int mmc_access_rpmb(struct mmc_queue *);
+
#endif
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 89/92] pinctrl: Don't just pretend to protect pinctrl_maps, do it for real
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (87 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 88/92] mmc: card: Don't access RPMB partitions for normal read/write Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 90/92] arm64: add missing PAGE_ALIGN() to __dma_free() Kamal Mostafa
` (2 subsequent siblings)
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Doug Anderson, Linus Walleij, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Doug Anderson <dianders@chromium.org>
commit c5272a28566b00cce79127ad382406e0a8650690 upstream.
Way back, when the world was a simpler place and there was no war, no
evil, and no kernel bugs, there was just a single pinctrl lock. That
was how the world was when (57291ce pinctrl: core device tree mapping
table parsing support) was written. In that case, there were
instances where the pinctrl mutex was already held when
pinctrl_register_map() was called, hence a "locked" parameter was
passed to the function to indicate that the mutex was already locked
(so we shouldn't lock it again).
A few years ago in (42fed7b pinctrl: move subsystem mutex to
pinctrl_dev struct), we switched to a separate pinctrl_maps_mutex.
...but (oops) we forgot to re-think about the whole "locked" parameter
for pinctrl_register_map(). Basically the "locked" parameter appears
to still refer to whether the bigger pinctrl_dev mutex is locked, but
we're using it to skip locks of our (now separate) pinctrl_maps_mutex.
That's kind of a bad thing(TM). Probably nobody noticed because most
of the calls to pinctrl_register_map happen at boot time and we've got
synchronous device probing. ...and even cases where we're
asynchronous don't end up actually hitting the race too often. ...but
after banging my head against the wall for a bug that reproduced 1 out
of 1000 reboots and lots of looking through kgdb, I finally noticed
this.
Anyway, we can now safely remove the "locked" parameter and go back to
a war-free, evil-free, and kernel-bug-free world.
Fixes: 42fed7ba44e4 ("pinctrl: move subsystem mutex to pinctrl_dev struct")
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/pinctrl/core.c | 10 ++++------
drivers/pinctrl/core.h | 2 +-
drivers/pinctrl/devicetree.c | 2 +-
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 89dca77..18ee208 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1110,7 +1110,7 @@ void devm_pinctrl_put(struct pinctrl *p)
EXPORT_SYMBOL_GPL(devm_pinctrl_put);
int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
- bool dup, bool locked)
+ bool dup)
{
int i, ret;
struct pinctrl_maps *maps_node;
@@ -1178,11 +1178,9 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
maps_node->maps = maps;
}
- if (!locked)
- mutex_lock(&pinctrl_maps_mutex);
+ mutex_lock(&pinctrl_maps_mutex);
list_add_tail(&maps_node->node, &pinctrl_maps);
- if (!locked)
- mutex_unlock(&pinctrl_maps_mutex);
+ mutex_unlock(&pinctrl_maps_mutex);
return 0;
}
@@ -1197,7 +1195,7 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
int pinctrl_register_mappings(struct pinctrl_map const *maps,
unsigned num_maps)
{
- return pinctrl_register_map(maps, num_maps, true, false);
+ return pinctrl_register_map(maps, num_maps, true);
}
void pinctrl_unregister_map(struct pinctrl_map const *map)
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index 75476b3..b24ea84 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -183,7 +183,7 @@ static inline struct pin_desc *pin_desc_get(struct pinctrl_dev *pctldev,
}
int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
- bool dup, bool locked);
+ bool dup);
void pinctrl_unregister_map(struct pinctrl_map const *map);
extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev);
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
index eda13de..0bbf7d7 100644
--- a/drivers/pinctrl/devicetree.c
+++ b/drivers/pinctrl/devicetree.c
@@ -92,7 +92,7 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename,
dt_map->num_maps = num_maps;
list_add_tail(&dt_map->node, &p->dt_maps);
- return pinctrl_register_map(map, num_maps, false, true);
+ return pinctrl_register_map(map, num_maps, false);
}
struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 90/92] arm64: add missing PAGE_ALIGN() to __dma_free()
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (88 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 89/92] pinctrl: Don't just pretend to protect pinctrl_maps, do it for real Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 91/92] vhost/scsi: potential memory corruption Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 92/92] md/raid0: fix restore to sector variable in raid0_make_request Kamal Mostafa
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: Dean Nelson, Will Deacon, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dean Nelson <dnelson@redhat.com>
commit 2cff98b99c469880ce830cbcde015b53b67e0a7b upstream.
__dma_alloc() does a PAGE_ALIGN() on the passed in size argument before
doing anything else. __dma_free() does not. And because it doesn't, it is
possible to leak memory should size not be an integer multiple of PAGE_SIZE.
The solution is to add a PAGE_ALIGN() to __dma_free() like is done in
__dma_alloc().
Additionally, this patch removes a redundant PAGE_ALIGN() from
__dma_alloc_coherent(), since __dma_alloc_coherent() can only be called
from __dma_alloc(), which already does a PAGE_ALIGN() before the call.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[ Dean Nelson: backport to 3.19-stable ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
arch/arm64/mm/dma-mapping.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 6efbb52..7980c2a 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -133,7 +133,7 @@ static void __dma_free_coherent(struct device *dev, size_t size,
freed = dma_release_from_contiguous(dev,
phys_to_page(paddr),
- size >> PAGE_SHIFT);
+ PAGE_ALIGN(size) >> PAGE_SHIFT);
if (!freed)
swiotlb_free_coherent(dev, size, vaddr, dma_handle);
}
@@ -189,6 +189,8 @@ static void __dma_free_noncoherent(struct device *dev, size_t size,
{
void *swiotlb_addr = phys_to_virt(dma_to_phys(dev, dma_handle));
+ size = PAGE_ALIGN(size);
+
if (__free_from_pool(vaddr, size))
return;
vunmap(vaddr);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 91/92] vhost/scsi: potential memory corruption
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (89 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 90/92] arm64: add missing PAGE_ALIGN() to __dma_free() Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 92/92] md/raid0: fix restore to sector variable in raid0_make_request Kamal Mostafa
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team
Cc: Dan Carpenter, Nicholas Bellinger, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 59c816c1f24df0204e01851431d3bab3eb76719c upstream.
This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt"
to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16.
I looked at the context and it turns out that in
vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into
the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so
anything higher than 255 then it is invalid. I have made that the limit
now.
In vhost_scsi_send_evt() we mask away values higher than 255, but now
that the limit has changed, we don't need the mask.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Reference: CVE-2015-4036
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/vhost/scsi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index d695b16..be0517f 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1253,7 +1253,7 @@ tcm_vhost_send_evt(struct vhost_scsi *vs,
* lun[4-7] need to be zero according to virtio-scsi spec.
*/
evt->event.lun[0] = 0x01;
- evt->event.lun[1] = tpg->tport_tpgt & 0xFF;
+ evt->event.lun[1] = tpg->tport_tpgt;
if (lun->unpacked_lun >= 256)
evt->event.lun[2] = lun->unpacked_lun >> 8 | 0x40 ;
evt->event.lun[3] = lun->unpacked_lun & 0xFF;
@@ -2124,12 +2124,12 @@ tcm_vhost_make_tpg(struct se_wwn *wwn,
struct tcm_vhost_tport, tport_wwn);
struct tcm_vhost_tpg *tpg;
- unsigned long tpgt;
+ u16 tpgt;
int ret;
if (strstr(name, "tpgt_") != name)
return ERR_PTR(-EINVAL);
- if (kstrtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)
+ if (kstrtou16(name + 5, 10, &tpgt) || tpgt >= VHOST_SCSI_MAX_TARGET)
return ERR_PTR(-EINVAL);
tpg = kzalloc(sizeof(struct tcm_vhost_tpg), GFP_KERNEL);
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
* [PATCH 3.19.y-ckt 92/92] md/raid0: fix restore to sector variable in raid0_make_request
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
` (90 preceding siblings ...)
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 91/92] vhost/scsi: potential memory corruption Kamal Mostafa
@ 2015-05-26 15:41 ` Kamal Mostafa
91 siblings, 0 replies; 93+ messages in thread
From: Kamal Mostafa @ 2015-05-26 15:41 UTC (permalink / raw)
To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa
3.19.8-ckt1 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Work <work.eric@gmail.com>
commit a81157768a00e8cf8a7b43b5ea5cac931262374f upstream.
The variable "sector" in "raid0_make_request()" was improperly updated
by a call to "sector_div()" which modifies its first argument in place.
Commit 47d68979cc968535cb87f3e5f2e6a3533ea48fbd restored this variable
after the call for later re-use. Unfortunetly the restore was done after
the referenced variable "bio" was advanced. This lead to the original
value and the restored value being different. Here we move this line to
the proper place.
One observed side effect of this bug was discarding a file though
unlinking would cause an unrelated file's contents to be discarded.
Signed-off-by: NeilBrown <neilb@suse.de>
Fixes: 47d68979cc96 ("md/raid0: fix bug with chunksize not a power of 2.")
URL: https://bugzilla.kernel.org/show_bug.cgi?id=98501
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/md/raid0.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index d5c12e5..b974ff2 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -530,6 +530,9 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio)
? (sector & (chunk_sects-1))
: sector_div(sector, chunk_sects));
+ /* Restore due to sector_div */
+ sector = bio->bi_iter.bi_sector;
+
if (sectors < bio_sectors(bio)) {
split = bio_split(bio, sectors, GFP_NOIO, fs_bio_set);
bio_chain(split, bio);
@@ -537,7 +540,6 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio)
split = bio;
}
- sector = bio->bi_iter.bi_sector;
zone = find_zone(mddev->private, §or);
tmp_dev = map_sector(mddev, zone, sector, §or);
split->bi_bdev = tmp_dev->bdev;
--
1.9.1
^ permalink raw reply [flat|nested] 93+ messages in thread
end of thread, other threads:[~2015-05-26 16:13 UTC | newest]
Thread overview: 93+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-26 15:40 [3.19.y-ckt stable] Linux 3.19.8-ckt1 stable review Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 01/92] ext4: allocate entire range in zero range Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 02/92] x86/microcode/intel: Guard against stack overflow in the loader Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 03/92] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe() Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 04/92] ASoC: samsung: s3c24xx-i2s: Fix return value check in s3c24xx_iis_dev_probe() Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 05/92] ASoC: dapm: Enable autodisable on SOC_DAPM_SINGLE_TLV_AUTODISABLE Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 06/92] ASoC: rt5677: add register patch for PLL Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 07/92] btrfs: unlock i_mutex after attempting to delete subvolume during send Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 08/92] ALSA: hda - Fix mute-LED fixed mode Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 09/92] ALSA: hda - Add mute-LED mode control to Thinkpad Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 10/92] arm64: dma-mapping: always clear allocated buffers Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 11/92] ALSA: emu10k1: Fix card shortname string buffer overflow Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 12/92] ALSA: emux: Fix mutex deadlock at unloading Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 13/92] drm/radeon: Use drm_calloc_ab for CS relocs Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 14/92] drm/radeon: adjust pll when audio is not enabled Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 15/92] drm/radeon: add SI DPM quirk for Sapphire R9 270 Dual-X 2G GDDR5 Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 16/92] drm/radeon: fix lockup when BOs aren't part of the VM on release Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 17/92] drm/radeon: reset BOs address after clearing it Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 18/92] drm/radeon: check new address before removing old one Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 19/92] SCSI: add 1024 max sectors black list flag Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 20/92] 3w-sas: fix command completion race Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 21/92] 3w-xxxx: " Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 22/92] 3w-9xxx: " Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 23/92] uas: Allow uas_use_uas_driver to return usb-storage flags Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 24/92] uas: Add US_FL_MAX_SECTORS_240 flag Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 25/92] uas: Set max_sectors_240 quirk for ASM1053 devices Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 26/92] usb: chipidea: otg: remove mutex unlock and lock while stop and start role Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 27/92] cdc-acm: prevent infinite loop when parsing CDC headers Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 28/92] serial: xilinx: Use platform_get_irq to get irq description structure Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 29/92] serial: of-serial: Remove device_type = "serial" registration Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 30/92] tty/serial: at91: maxburst was missing for dma transfers Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 31/92] ALSA: emux: Fix mutex deadlock in OSS emulation Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 32/92] ACPI / SBS: Enable battery manager when present Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 33/92] ALSA: emu10k1: Emu10k2 32 bit DMA mode Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 34/92] ASoC: rt5677: fixed wrong DMIC ref clock Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 35/92] rbd: end I/O the entire obj_request on error Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 36/92] ext4: fix data corruption caused by unwritten and delayed extents Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 37/92] ext4: move check under lock scope to close a race Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 38/92] powerpc/pseries: Correct cpu affinity for dlpar added cpus Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 39/92] powerpc/powernv: Restore non-volatile CRs after nap Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 40/92] efivarfs: Ensure VariableName is NUL-terminated Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 41/92] x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 42/92] blk-mq: fix race between timeout and CPU hotplug Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 43/92] blk-mq: fix CPU hotplug handling Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 44/92] writeback: use |1 instead of +1 to protect against div by zero Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 45/92] ARM: mvebu: armada-xp-openblocks-ax3-4: Disable internal RTC Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 46/92] ARM: dts: imx23-olinuxino: Fix polarity of LED GPIO Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 47/92] ARM: dts: imx23-olinuxino: Fix dr_mode of usb0 Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 48/92] ARM: dts: imx6: phyFLEX: USB VBUS control is active-high Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 49/92] ARM: dts: imx25: Add #pwm-cells to pwm4 Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 50/92] ARM: dts: imx28: Fix AUART4 TX-DMA interrupt name Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 51/92] [media] marvell-ccic: fix Y'CbCr ordering Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 52/92] gpio: sysfs: fix memory leaks and device hotplug Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 53/92] ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 54/92] ACPI / PNP: add two IDs to list for PNPACPI device enumeration Kamal Mostafa
2015-05-26 15:40 ` [PATCH 3.19.y-ckt 55/92] ARM: OMAP2+: Fix omap off idle power consumption creeping up Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 56/92] ARM: dts: OMAP3-N900: Add microphone bias voltages Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 57/92] drm/radeon: disable semaphores for UVD V1 (v2) Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 58/92] x86/spinlocks: Fix regression in spinlock contention detection Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 59/92] RDMA/CMA: Canonize IPv4 on IPV6 sockets properly Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 60/92] drm/i915: Assume dual channel LVDS if pixel clock necessitates it Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 61/92] drm/i915: Add missing MacBook Pro models with dual channel LVDS Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 62/92] efi: Fix error handling in add_sysfs_runtime_map_entry() Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 63/92] Revert "dm crypt: fix deadlock when async crypto algorithm returns -EBUSY" Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 64/92] xen/events: Clear cpu_evtchn_mask before resuming Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 65/92] xen/xenbus: Update xenbus event channel on resume Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 66/92] xen/console: Update console " Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 67/92] xen/events: Set irq_info->evtchn before binding the channel to CPU in __startup_pirq() Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 68/92] mm/memory-failure: call shake_page() when error hits thp tail page Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 69/92] mm: soft-offline: fix num_poisoned_pages counting on concurrent events Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 70/92] nilfs2: fix sanity check of btree level in nilfs_btree_root_broken() Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 71/92] ocfs2: dlm: fix race between purge and get lock resource Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 72/92] drm/i915/dp: there is no audio on port A Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 73/92] drm/amdkfd: allow unregister process with queues Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 74/92] drm/radeon: fix userptr BO unpin bug v3 Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 75/92] drm/radeon: make VCE handle check more strict Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 76/92] drm/radeon: make UVD handle checking " Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 77/92] drm/radeon: more strictly validate the UVD codec Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 78/92] path_openat(): fix double fput() Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 79/92] mnt: Fix fs_fully_visible to verify the root directory is visible Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 80/92] drm: Zero out invalid vblank timestamp in drm_update_vblank_count Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 81/92] ARM: ux500: Move GPIO regulator for SD-card into board DTSs Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 82/92] ARM: ux500: Enable GPIO regulator for SD-card for HREF boards Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 83/92] ARM: ux500: Enable GPIO regulator for SD-card for snowball Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 84/92] xen-pciback: Add name prefix to global 'permissive' variable Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 85/92] mmc: core: add missing pm event in mmc_pm_notify to fix hib restore Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 86/92] ARM: dts: am57xx-beagle-x15: Fix IRQ type for mcp7941x Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 87/92] mmc: sh_mmcif: Fix timeout value for command request Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 88/92] mmc: card: Don't access RPMB partitions for normal read/write Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 89/92] pinctrl: Don't just pretend to protect pinctrl_maps, do it for real Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 90/92] arm64: add missing PAGE_ALIGN() to __dma_free() Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 91/92] vhost/scsi: potential memory corruption Kamal Mostafa
2015-05-26 15:41 ` [PATCH 3.19.y-ckt 92/92] md/raid0: fix restore to sector variable in raid0_make_request Kamal Mostafa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®