Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
Merge 4.4.122 into 8.x-unified
Browse files Browse the repository at this point in the history
Changes in 4.4.122: (64 commits)
        RDMA/ucma: Limit possible option size
        RDMA/ucma: Check that user doesn't overflow QP state
        RDMA/mlx5: Fix integer overflow while resizing CQ
        scsi: qla2xxx: Fix NULL pointer crash due to active timer for ABTS
        workqueue: Allow retrieval of current task's work struct
        drm: Allow determining if current task is output poll worker
        drm/nouveau: Fix deadlock on runtime suspend
        drm/radeon: Fix deadlock on runtime suspend
        drm/amdgpu: Fix deadlock on runtime suspend
        drm/amdgpu: Notify sbios device ready before send request
        drm/radeon: fix KV harvesting
        drm/amdgpu: fix KV harvesting
        MIPS: BMIPS: Do not mask IPIs during suspend
        MIPS: ath25: Check for kzalloc allocation failure
        MIPS: OCTEON: irq: Check for null return on kzalloc allocation
        Input: matrix_keypad - fix race when disabling interrupts
        loop: Fix lost writes caused by missing flag
        kbuild: Handle builtin dtb file names containing hyphens
        bcache: don't attach backing with duplicate UUID
        x86/MCE: Serialize sysfs changes
        ALSA: hda/realtek - Fix dock line-out volume on Dell Precision 7520
        ALSA: seq: Don't allow resizing pool in use
        ALSA: seq: More protection for concurrent write and ioctl races
        ALSA: hda: add dock and led support for HP EliteBook 820 G3
        ALSA: hda: add dock and led support for HP ProBook 640 G2
        nospec: Include <asm/barrier.h> dependency
        watchdog: hpwdt: SMBIOS check
        watchdog: hpwdt: Check source of NMI
        watchdog: hpwdt: fix unused variable warning
        netfilter: nfnetlink_queue: fix timestamp attribute
        ARM: omap2: hide omap3_save_secure_ram on non-OMAP3 builds
        Input: tca8418_keypad - remove double read of key event register
        tc358743: fix register i2c_rd/wr function fix
        netfilter: add back stackpointer size checks
        netfilter: x_tables: fix missing timer initialization in xt_LED
        netfilter: nat: cope with negative port range
        netfilter: IDLETIMER: be syzkaller friendly
        netfilter: ebtables: CONFIG_COMPAT: don't trust userland offsets
        netfilter: bridge: ebt_among: add missing match size checks
        netfilter: ipv6: fix use-after-free Write in nf_nat_ipv6_manip_pkt
        netfilter: use skb_to_full_sk in ip_route_me_harder
        netfilter: x_tables: pass xt_counters struct instead of packet counter
        netfilter: x_tables: pass xt_counters struct to counter allocator
        netfilter: x_tables: pack percpu counter allocations
        ext4: inplace xattr block update fails to deduplicate blocks
        ubi: Fix race condition between ubi volume creation and udev
        scsi: qla2xxx: Replace fcport alloc with qla2x00_alloc_fcport
        NFS: Fix an incorrect type in struct nfs_direct_req
        Revert "ARM: dts: LogicPD Torpedo: Fix I2C1 pinmux"
        x86/module: Detect and skip invalid relocations
        x86: Treat R_X86_64_PLT32 as R_X86_64_PC32
        serial: sh-sci: prevent lockup on full TTY buffers
        tty/serial: atmel: add new version check for usart
        uas: fix comparison for error code
        staging: comedi: fix comedi_nsamples_left.
        staging: android: ashmem: Fix lockdep issue during llseek
        USB: storage: Add JMicron bridge 152d:2567 to unusual_devs.h
        usb: quirks: add control message delay for 1b1c:1b20
        USB: usbmon: remove assignment from IS_ERR argument
        usb: usbmon: Read text within supplied buffer size
        usb: gadget: f_fs: Fix use-after-free in ffs_fs_kill_sb()
        serial: 8250_pci: Add Brainboxes UC-260 4 port serial device
        fixup: sctp: verify size of a new chunk in _sctp_make_chunk()
        Linux 4.4.122

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
  • Loading branch information
nathanchance committed Mar 18, 2018
2 parents ecb7d85 + b8ea1f9 commit 140a8df
Show file tree
Hide file tree
Showing 67 changed files with 571 additions and 288 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 121
SUBLEVEL = 122
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
8 changes: 0 additions & 8 deletions arch/arm/boot/dts/logicpd-torpedo-som.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@
};

&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
clock-frequency = <2600000>;

twl: twl@48 {
Expand Down Expand Up @@ -148,12 +146,6 @@
OMAP3630_CORE2_IOPAD(0x25da, PIN_INPUT_PULLUP | MUX_MODE2) /* etk_ctl.sdmmc3_cmd */
>;
};
i2c1_pins: pinmux_i2c1_pins {
pinctrl-single,pins = <
OMAP3_CORE1_IOPAD(0x21ba, PIN_INPUT | MUX_MODE0) /* i2c1_scl.i2c1_scl */
OMAP3_CORE1_IOPAD(0x21bc, PIN_INPUT | MUX_MODE0) /* i2c1_sda.i2c1_sda */
>;
};
};

#include "twl4030.dtsi"
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-omap2/omap-secure.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ phys_addr_t omap_secure_ram_mempool_base(void)
return omap_secure_memblock_base;
}

#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
u32 omap3_save_secure_ram(void __iomem *addr, int size)
{
u32 ret;
Expand All @@ -91,6 +92,7 @@ u32 omap3_save_secure_ram(void __iomem *addr, int size)

return ret;
}
#endif

/**
* rx51_secure_dispatcher: Routine to dispatch secure PPA API calls
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/ath25/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ int __init ath25_find_config(phys_addr_t base, unsigned long size)
}

board_data = kzalloc(BOARD_CONFIG_BUFSZ, GFP_KERNEL);
if (!board_data)
goto error;
ath25_board.config = (struct ath25_boarddata *)board_data;
memcpy_fromio(board_data, bcfg, 0x100);
if (broken_boarddata) {
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/cavium-octeon/octeon-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,8 @@ static int __init octeon_irq_init_cib(struct device_node *ciu_node,
}

host_data = kzalloc(sizeof(*host_data), GFP_KERNEL);
if (!host_data)
return -ENOMEM;
raw_spin_lock_init(&host_data->lock);

addr = of_get_address(ciu_node, 0, NULL, NULL);
Expand Down
8 changes: 4 additions & 4 deletions arch/mips/kernel/smp-bmips.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ static void bmips_prepare_cpus(unsigned int max_cpus)
return;
}

if (request_irq(IPI0_IRQ, bmips_ipi_interrupt, IRQF_PERCPU,
"smp_ipi0", NULL))
if (request_irq(IPI0_IRQ, bmips_ipi_interrupt,
IRQF_PERCPU | IRQF_NO_SUSPEND, "smp_ipi0", NULL))
panic("Can't request IPI0 interrupt");
if (request_irq(IPI1_IRQ, bmips_ipi_interrupt, IRQF_PERCPU,
"smp_ipi1", NULL))
if (request_irq(IPI1_IRQ, bmips_ipi_interrupt,
IRQF_PERCPU | IRQF_NO_SUSPEND, "smp_ipi1", NULL))
panic("Can't request IPI1 interrupt");
}

Expand Down
22 changes: 21 additions & 1 deletion arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ static DEFINE_MUTEX(mce_chrdev_read_mutex);
smp_load_acquire(&(p)); \
})

/* sysfs synchronization */
static DEFINE_MUTEX(mce_sysfs_mutex);

#define CREATE_TRACE_POINTS
#include <trace/events/mce.h>

Expand Down Expand Up @@ -2220,6 +2223,7 @@ static ssize_t set_ignore_ce(struct device *s,
if (kstrtou64(buf, 0, &new) < 0)
return -EINVAL;

mutex_lock(&mce_sysfs_mutex);
if (mca_cfg.ignore_ce ^ !!new) {
if (new) {
/* disable ce features */
Expand All @@ -2232,6 +2236,8 @@ static ssize_t set_ignore_ce(struct device *s,
on_each_cpu(mce_enable_ce, (void *)1, 1);
}
}
mutex_unlock(&mce_sysfs_mutex);

return size;
}

Expand All @@ -2244,6 +2250,7 @@ static ssize_t set_cmci_disabled(struct device *s,
if (kstrtou64(buf, 0, &new) < 0)
return -EINVAL;

mutex_lock(&mce_sysfs_mutex);
if (mca_cfg.cmci_disabled ^ !!new) {
if (new) {
/* disable cmci */
Expand All @@ -2255,15 +2262,28 @@ static ssize_t set_cmci_disabled(struct device *s,
on_each_cpu(mce_enable_ce, NULL, 1);
}
}
mutex_unlock(&mce_sysfs_mutex);

return size;
}

static ssize_t store_int_with_restart(struct device *s,
struct device_attribute *attr,
const char *buf, size_t size)
{
ssize_t ret = device_store_int(s, attr, buf, size);
unsigned long old_check_interval = check_interval;
ssize_t ret = device_store_ulong(s, attr, buf, size);

if (check_interval == old_check_interval)
return ret;

if (check_interval < 1)
check_interval = 1;

mutex_lock(&mce_sysfs_mutex);
mce_restart();
mutex_unlock(&mce_sysfs_mutex);

return ret;
}

Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/machine_kexec_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ int arch_kexec_apply_relocations_add(const Elf64_Ehdr *ehdr,
goto overflow;
break;
case R_X86_64_PC32:
case R_X86_64_PLT32:
value -= (u64)address;
*(u32 *)location = value;
break;
Expand Down
14 changes: 14 additions & 0 deletions arch/x86/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,28 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
case R_X86_64_NONE:
break;
case R_X86_64_64:
if (*(u64 *)loc != 0)
goto invalid_relocation;
*(u64 *)loc = val;
break;
case R_X86_64_32:
if (*(u32 *)loc != 0)
goto invalid_relocation;
*(u32 *)loc = val;
if (val != *(u32 *)loc)
goto overflow;
break;
case R_X86_64_32S:
if (*(s32 *)loc != 0)
goto invalid_relocation;
*(s32 *)loc = val;
if ((s64)val != *(s32 *)loc)
goto overflow;
break;
case R_X86_64_PC32:
case R_X86_64_PLT32:
if (*(u32 *)loc != 0)
goto invalid_relocation;
val -= (u64)loc;
*(u32 *)loc = val;
#if 0
Expand All @@ -198,6 +207,11 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
}
return 0;

invalid_relocation:
pr_err("x86/modules: Skipping invalid relocation target, existing value is nonzero for type %d, loc %p, val %Lx\n",
(int)ELF64_R_TYPE(rel[i].r_info), loc, val);
return -ENOEXEC;

overflow:
pr_err("overflow in relocation type %d val %Lx\n",
(int)ELF64_R_TYPE(rel[i].r_info), val);
Expand Down
3 changes: 3 additions & 0 deletions arch/x86/tools/relocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,12 @@ static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
break;

case R_X86_64_PC32:
case R_X86_64_PLT32:
/*
* PC relative relocations don't need to be adjusted unless
* referencing a percpu symbol.
*
* NB: R_X86_64_PLT32 can be treated as R_X86_64_PC32.
*/
if (is_percpu_sym(sym, symname))
add_reloc(&relocs32neg, offset);
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ static int lo_write_bvec(struct file *file, struct bio_vec *bvec, loff_t *ppos)
struct iov_iter i;
ssize_t bw;

iov_iter_bvec(&i, ITER_BVEC, bvec, 1, bvec->bv_len);
iov_iter_bvec(&i, ITER_BVEC | WRITE, bvec, 1, bvec->bv_len);

file_start_write(file);
bw = vfs_iter_write(file, &i, ppos);
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,9 @@ int amdgpu_acpi_pcie_performance_request(struct amdgpu_device *adev,
size_t size;
u32 retry = 3;

if (amdgpu_acpi_pcie_notify_device_ready(adev))
return -EINVAL;

/* Get the device handle */
handle = ACPI_HANDLE(&adev->pdev->dev);
if (!handle)
Expand Down
58 changes: 38 additions & 20 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,11 @@ amdgpu_connector_lvds_detect(struct drm_connector *connector, bool force)
enum drm_connector_status ret = connector_status_disconnected;
int r;

r = pm_runtime_get_sync(connector->dev->dev);
if (r < 0)
return connector_status_disconnected;
if (!drm_kms_helper_is_poll_worker()) {
r = pm_runtime_get_sync(connector->dev->dev);
if (r < 0)
return connector_status_disconnected;
}

if (encoder) {
struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder);
Expand All @@ -760,8 +762,12 @@ amdgpu_connector_lvds_detect(struct drm_connector *connector, bool force)
/* check acpi lid status ??? */

amdgpu_connector_update_scratch_regs(connector, ret);
pm_runtime_mark_last_busy(connector->dev->dev);
pm_runtime_put_autosuspend(connector->dev->dev);

if (!drm_kms_helper_is_poll_worker()) {
pm_runtime_mark_last_busy(connector->dev->dev);
pm_runtime_put_autosuspend(connector->dev->dev);
}

return ret;
}

Expand Down Expand Up @@ -862,9 +868,11 @@ amdgpu_connector_vga_detect(struct drm_connector *connector, bool force)
enum drm_connector_status ret = connector_status_disconnected;
int r;

r = pm_runtime_get_sync(connector->dev->dev);
if (r < 0)
return connector_status_disconnected;
if (!drm_kms_helper_is_poll_worker()) {
r = pm_runtime_get_sync(connector->dev->dev);
if (r < 0)
return connector_status_disconnected;
}

encoder = amdgpu_connector_best_single_encoder(connector);
if (!encoder)
Expand Down Expand Up @@ -918,8 +926,10 @@ amdgpu_connector_vga_detect(struct drm_connector *connector, bool force)
amdgpu_connector_update_scratch_regs(connector, ret);

out:
pm_runtime_mark_last_busy(connector->dev->dev);
pm_runtime_put_autosuspend(connector->dev->dev);
if (!drm_kms_helper_is_poll_worker()) {
pm_runtime_mark_last_busy(connector->dev->dev);
pm_runtime_put_autosuspend(connector->dev->dev);
}

return ret;
}
Expand Down Expand Up @@ -981,9 +991,11 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)
enum drm_connector_status ret = connector_status_disconnected;
bool dret = false, broken_edid = false;

r = pm_runtime_get_sync(connector->dev->dev);
if (r < 0)
return connector_status_disconnected;
if (!drm_kms_helper_is_poll_worker()) {
r = pm_runtime_get_sync(connector->dev->dev);
if (r < 0)
return connector_status_disconnected;
}

if (!force && amdgpu_connector_check_hpd_status_unchanged(connector)) {
ret = connector->status;
Expand Down Expand Up @@ -1108,8 +1120,10 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)
amdgpu_connector_update_scratch_regs(connector, ret);

exit:
pm_runtime_mark_last_busy(connector->dev->dev);
pm_runtime_put_autosuspend(connector->dev->dev);
if (!drm_kms_helper_is_poll_worker()) {
pm_runtime_mark_last_busy(connector->dev->dev);
pm_runtime_put_autosuspend(connector->dev->dev);
}

return ret;
}
Expand Down Expand Up @@ -1351,9 +1365,11 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force)
struct drm_encoder *encoder = amdgpu_connector_best_single_encoder(connector);
int r;

r = pm_runtime_get_sync(connector->dev->dev);
if (r < 0)
return connector_status_disconnected;
if (!drm_kms_helper_is_poll_worker()) {
r = pm_runtime_get_sync(connector->dev->dev);
if (r < 0)
return connector_status_disconnected;
}

if (!force && amdgpu_connector_check_hpd_status_unchanged(connector)) {
ret = connector->status;
Expand Down Expand Up @@ -1421,8 +1437,10 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force)

amdgpu_connector_update_scratch_regs(connector, ret);
out:
pm_runtime_mark_last_busy(connector->dev->dev);
pm_runtime_put_autosuspend(connector->dev->dev);
if (!drm_kms_helper_is_poll_worker()) {
pm_runtime_mark_last_busy(connector->dev->dev);
pm_runtime_put_autosuspend(connector->dev->dev);
}

return ret;
}
Expand Down
30 changes: 2 additions & 28 deletions drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2104,34 +2104,8 @@ static void gfx_v7_0_gpu_init(struct amdgpu_device *adev)
case CHIP_KAVERI:
adev->gfx.config.max_shader_engines = 1;
adev->gfx.config.max_tile_pipes = 4;
if ((adev->pdev->device == 0x1304) ||
(adev->pdev->device == 0x1305) ||
(adev->pdev->device == 0x130C) ||
(adev->pdev->device == 0x130F) ||
(adev->pdev->device == 0x1310) ||
(adev->pdev->device == 0x1311) ||
(adev->pdev->device == 0x131C)) {
adev->gfx.config.max_cu_per_sh = 8;
adev->gfx.config.max_backends_per_se = 2;
} else if ((adev->pdev->device == 0x1309) ||
(adev->pdev->device == 0x130A) ||
(adev->pdev->device == 0x130D) ||
(adev->pdev->device == 0x1313) ||
(adev->pdev->device == 0x131D)) {
adev->gfx.config.max_cu_per_sh = 6;
adev->gfx.config.max_backends_per_se = 2;
} else if ((adev->pdev->device == 0x1306) ||
(adev->pdev->device == 0x1307) ||
(adev->pdev->device == 0x130B) ||
(adev->pdev->device == 0x130E) ||
(adev->pdev->device == 0x1315) ||
(adev->pdev->device == 0x131B)) {
adev->gfx.config.max_cu_per_sh = 4;
adev->gfx.config.max_backends_per_se = 1;
} else {
adev->gfx.config.max_cu_per_sh = 3;
adev->gfx.config.max_backends_per_se = 1;
}
adev->gfx.config.max_cu_per_sh = 8;
adev->gfx.config.max_backends_per_se = 2;
adev->gfx.config.max_sh_per_se = 1;
adev->gfx.config.max_texture_channel_caches = 4;
adev->gfx.config.max_gprs = 256;
Expand Down
Loading

0 comments on commit 140a8df

Please sign in to comment.