Skip to contentSkip to conversation

Linux 4.19.42

DISCUSSION Greg KH 1 participant 2 messages May 11, 2019 Stable branch

lore
Share & tools
lore

Greg KH

author maintainer
#0 lore raw

I'm announcing the release of the 4.19.42 kernel.

All users of the 4.19 kernel series must upgrade.

The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Makefile                                            |    2 
 arch/arm64/include/asm/futex.h                      |   55 +-
 arch/mips/kernel/kgdb.c                             |    3 
 arch/x86/events/intel/core.c                        |    8 
 drivers/block/virtio_blk.c                          |    2 
 drivers/clk/meson/gxbb.c                            |    2 
 drivers/cpufreq/armada-37xx-cpufreq.c               |   22 
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c   |    1 
 drivers/gpu/drm/mediatek/mtk_hdmi.c                 |    2 
 drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c             |   26 -
 drivers/gpu/drm/sun4i/sun8i_tcon_top.c              |    5 
 drivers/hv/hv.c                                     |    1 
 drivers/hwtracing/intel_th/pci.c                    |    5 
 drivers/infiniband/hw/hfi1/chip.c                   |   26 -
 drivers/infiniband/hw/hfi1/rc.c                     |    4 
 drivers/infiniband/hw/hns/hns_roce_hem.c            |    6 
 drivers/infiniband/hw/hns/hns_roce_mr.c             |    4 
 drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c      |    2 
 drivers/iommu/amd_iommu_init.c                      |    2 
 drivers/net/ethernet/stmicro/stmmac/norm_desc.c     |    2 
 drivers/nvme/host/fc.c                              |   20 
 drivers/platform/x86/pmc_atom.c                     |    2 
 drivers/scsi/csiostor/csio_scsi.c                   |    5 
 drivers/scsi/libsas/sas_expander.c                  |    9 
 drivers/scsi/lpfc/lpfc_attr.c                       |  180 ++++---
 drivers/scsi/lpfc/lpfc_ct.c                         |   12 
 drivers/scsi/lpfc/lpfc_debugfs.c                    |  453 ++++++++++----------
 drivers/scsi/lpfc/lpfc_debugfs.h                    |    6 
 drivers/scsi/qla2xxx/qla_attr.c                     |    4 
 drivers/scsi/qla2xxx/qla_target.c                   |    4 
 drivers/soc/sunxi/Kconfig                           |    1 
 drivers/staging/greybus/power_supply.c              |    2 
 drivers/staging/most/cdev/cdev.c                    |    2 
 drivers/usb/class/cdc-acm.c                         |   32 +
 drivers/usb/dwc3/core.c                             |    2 
 drivers/usb/musb/Kconfig                            |    2 
 drivers/usb/serial/f81232.c                         |   39 +
 drivers/usb/storage/scsiglue.c                      |   26 -
 drivers/usb/storage/uas.c                           |   35 -
 drivers/virtio/virtio_pci_common.c                  |    8 
 include/linux/kernel.h                              |    4 
 include/net/bluetooth/hci_core.h                    |    3 
 kernel/events/core.c                                |   52 +-
 kernel/events/ring_buffer.c                         |    4 
 kernel/futex.c                                      |  188 +++++---
 kernel/irq/manage.c                                 |    4 
 lib/ubsan.c                                         |   49 +-
 mm/slab.c                                           |    3 
 net/bluetooth/hci_conn.c                            |    8 
 net/bluetooth/hidp/sock.c                           |    1 
 sound/soc/codecs/cs35l35.c                          |   11 
 sound/soc/codecs/cs4270.c                           |    1 
 sound/soc/codecs/hdmi-codec.c                       |  118 ++---
 sound/soc/codecs/nau8810.c                          |    4 
 sound/soc/codecs/nau8824.c                          |   46 +-
 sound/soc/codecs/rt5682.c                           |   14 
 sound/soc/codecs/tlv320aic32x4.c                    |    2 
 sound/soc/codecs/tlv320aic3x.c                      |    5 
 sound/soc/codecs/wm_adsp.c                          |   11 
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c |    2 
 sound/soc/intel/common/sst-firmware.c               |    8 
 sound/soc/intel/skylake/skl-pcm.c                   |   19 
 sound/soc/rockchip/rockchip_pdm.c                   |    2 
 sound/soc/samsung/odroid.c                          |    4 
 sound/soc/soc-dapm.c                                |    4 
 sound/soc/soc-pcm.c                                 |    7 
 sound/soc/stm/stm32_adfsdm.c                        |   38 +
 sound/soc/stm/stm32_sai_sub.c                       |   15 
 tools/objtool/check.c                               |    1 
 69 files changed, 1006 insertions(+), 646 deletions(-)

Alan Stern (1):
usb-storage: Set virt_boundary_mask to avoid SG overflows

Alexander Shishkin (1):
intel_th: pci: Add Comet Lake support

Andrew Vasquez (1):
scsi: qla2xxx: Fix incorrect region-size setting in optrom SYSFS routines

Andrey Ryabinin (1):
ubsan: Fix nasty -Wbuiltin-declaration-mismatch GCC-9 warnings

Annaliese McDermond (1):
ASoC: tlv320aic32x4: Fix Common Pins

Charles Keepax (2):
ASoC: wm_adsp: Add locking to wm_adsp2_bus_error
ASoC: cs35l35: Disable regulators on driver removal

Chong Qiao (1):
MIPS: KGDB: fix kgdb support for SMP platforms.

Dan Carpenter (1):
drm/mediatek: Fix an error code in mtk_hdmi_dt_parse_pdata()

Daniel Mack (1):
ASoC: cs4270: Set auto-increment bit for register writes

Dexuan Cui (1):
Drivers: hv: vmbus: Remove the undesired put_cpu_ptr() in hv_synic_cleanup()

Dongli Zhang (1):
virtio-blk: limit number of hw queues by nr_cpu_ids

Greg Kroah-Hartman (1):

      Linux 4.19.42

Gregory CLEMENT (1):
cpufreq: armada-37xx: fix frequency calculation for opp

James Smart (1):
nvme-fc: correct csn initialization and increments on error

Jann Horn (1):
linux/kernel.h: Use parentheses around argument in u64_to_user_ptr()

Jason Yan (1):
scsi: libsas: fix a race condition when smp task timeout

Ji-Ze Hong (Peter Hong) (1):
USB: serial: f81232: fix interrupt worker not stop

Joerg Roedel (1):
iommu/amd: Set exclusion range correctly

Johan Hovold (2):
staging: greybus: power_supply: fix prop-descriptor request size
USB: cdc-acm: fix unthrottle races

John Hsu (2):
ASoC: nau8824: fix the issue of the widget with prefix name
ASoC: nau8810: fix the issue of widget with prefixed name

Josh Poimboeuf (1):
objtool: Add rewind_stack_do_exit() to the noreturn list

Kaike Wan (2):
IB/hfi1: Eliminate opcode tests on mr deref
IB/hfi1: Fix the allocation of RSM table

Kamal Heib (1):
RDMA/vmw_pvrdma: Fix memory leak on pvrdma_pci_remove

Lijun Ou (1):
RDMA/hns: Fix bug that caused srq creation to fail

Longpeng (1):
virtio_pci: fix a NULL pointer reference in vp_del_vqs

Marcel Holtmann (1):
Bluetooth: Align minimum encryption key size for LE and BR/EDR connections

Maxime Jourdan (1):
clk: meson-gxbb: round the vdec dividers to closest

Oliver Neukum (1):
UAS: fix alignment of scatter/gather segments

Olivier Moysan (4):
ASoC: stm32: sai: fix iec958 controls indexation
ASoC: stm32: sai: fix exposed capabilities in spdif mode
ASoC: stm32: dfsdm: manage multiple prepare
ASoC: stm32: dfsdm: fix debugfs warnings on entry creation

Ondrej Jirman (1):
drm/sun4i: tcon top: Fix NULL/invalid pointer dereference in sun8i_tcon_top_un/bind

Pankaj Bharadiya (1):
ASoC: dapm: Fix NULL pointer dereference in snd_soc_dapm_free_kcontrol

Peter Zijlstra (2):
perf/x86/intel: Initialize TFA MSR perf/core: Fix perf_event_disable_inatomic() race

Philipp Puschmann (1):
ASoC: tlv320aic3x: fix reset gpio reference counting

Prasad Sodagudi (1):
genirq: Prevent use-after-free and work list corruption

Qian Cai (1):
slab: fix a crash by reading /proc/slab_allocators

Quinn Tran (1):
scsi: qla2xxx: Fix device staying in blocked state

Rander Wang (2):
ASoC:soc-pcm:fix a codec fixup issue in TDM case ASoC:intel:skl:fix a simultaneous playback & capture issue on hda platform

Ross Zwisler (1):
ASoC: Intel: avoid Oops if DMA setup fails

Russell King (1):
ASoC: hdmi-codec: fix S/PDIF DAI

Samuel Holland (1):
soc: sunxi: Fix missing dependency on REGMAP_MMIO

Shuming Fan (1):
ASoC: rt5682: recording has no sound after booting

Silvio Cesare (1):
scsi: lpfc: change snprintf to scnprintf for possible overflow

Stephane Eranian (1):
perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS

Stephen Boyd (1):
platform/x86: pmc_atom: Drop __initconst on dmi table

Sugar Zhang (1):
ASoC: rockchip: pdm: fix regmap_ops hang issue

Suresh Udipi (1):
staging: most: cdev: fix chrdev_region leak in mod_exit

Sylwester Nawrocki (1):
ASoC: samsung: odroid: Fix clock configuration for 44100 sample rate

Thinh Nguyen (1):
usb: dwc3: Fix default lpm_nyet_threshold value

Tony Lindgren (1):
drm/omap: hdmi4_cec: Fix CEC clock handling for PM

Tzung-Bi Shih (1):
ASoC: Intel: kbl: fix wrong number of channels

Varun Prakash (1):
scsi: csiostor: fix missing data copy in csio_scsi_err_handler()

Wen Yang (1):
drm/mediatek: fix possible object reference leak

Will Deacon (2):
locking/futex: Allow low-level atomic operations to return -EAGAIN
arm64: futex: Bound number of LDXR/STXR loops in FUTEX_WAKE_OP

Young Xiao (1):
Bluetooth: hidp: fix buffer overflow

YueHaibing (1):
net: stmmac: Use bfsize1 in ndesc_init_rx_desc

tiancyin (1):
drm/amd/display: fix cursor black issue

author maintainer
#1 lore raw
Makefile +1 -1
index ba3b8504b689..914d69b9e3fd 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 4
 PATCHLEVEL = 19
-SUBLEVEL = 41
+SUBLEVEL = 42
 EXTRAVERSION =
 NAME = "People's Front"
 
arch/arm64/include/asm/futex.h +34 -21

109 lines not on this page · raw message

arch/mips/kernel/kgdb.c +2 -1
index eb6c0d582626..2c1e30ca7ee4 100644
@@ -33,6 +33,7 @@
 #include <asm/processor.h>
 #include <asm/sigcontext.h>
 #include <linux/uaccess.h>
+#include <asm/irq_regs.h>
 
 static struct hard_trap_info {
 	unsigned char tt;	/* Trap type code for MIPS R3xxx and R4xxx */
@@ -214,7 +215,7 @@ static void kgdb_call_nmi_hook(void *ignored)
 	old_fs = get_fs();
 	set_fs(get_ds());
 
-	kgdb_nmicallback(raw_smp_processor_id(), NULL);
+	kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
 
 	set_fs(old_fs);
 }
arch/x86/events/intel/core.c +7 -1
index 3dd204d1dd19..f9958ad4d335 100644
@@ -3068,7 +3068,7 @@ static int intel_pmu_hw_config(struct perf_event *event)
 		return ret;
 
 	if (event->attr.precise_ip) {
-		if (!event->attr.freq) {
+		if (!(event->attr.freq || event->attr.wakeup_events)) {
 			event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;
 			if (!(event->attr.sample_type &
 			      ~intel_pmu_large_pebs_flags(event)))
@@ -3447,6 +3447,12 @@ static void intel_pmu_cpu_starting(int cpu)
 
 	cpuc->lbr_sel = NULL;
 
+	if (x86_pmu.flags & PMU_FL_TFA) {
+		WARN_ON_ONCE(cpuc->tfa_shadow);
+		cpuc->tfa_shadow = ~0ULL;
+		intel_set_tfa(cpuc, false);
+	}
+
 	if (x86_pmu.version > 1)
 		flip_smm_bit(&x86_pmu.attr_freeze_on_smi);
 
drivers/block/virtio_blk.c +2 -0
index 23752dc99b00..dd64f586679e 100644
@@ -446,6 +446,8 @@ static int init_vq(struct virtio_blk *vblk)
 	if (err)
 		num_vqs = 1;
 
+	num_vqs = min_t(unsigned int, nr_cpu_ids, num_vqs);
+
 	vblk->vqs = kmalloc_array(num_vqs, sizeof(*vblk->vqs), GFP_KERNEL);
 	if (!vblk->vqs)
 		return -ENOMEM;
drivers/clk/meson/gxbb.c +2 -0
index 6628ffa31383..4d4f6d842c31 100644
@@ -1571,6 +1571,7 @@ static struct clk_regmap gxbb_vdec_1_div = {
 		.offset = HHI_VDEC_CLK_CNTL,
 		.shift = 0,
 		.width = 7,
+		.flags = CLK_DIVIDER_ROUND_CLOSEST,
 	},
 	.hw.init = &(struct clk_init_data){
 		.name = "vdec_1_div",
@@ -1616,6 +1617,7 @@ static struct clk_regmap gxbb_vdec_hevc_div = {
 		.offset = HHI_VDEC2_CLK_CNTL,
 		.shift = 16,
 		.width = 7,
+		.flags = CLK_DIVIDER_ROUND_CLOSEST,
 	},
 	.hw.init = &(struct clk_init_data){
 		.name = "vdec_hevc_div",
drivers/cpufreq/armada-37xx-cpufreq.c +19 -3
index 75491fc841a6..0df16eb1eb3c 100644
@@ -359,11 +359,11 @@ static int __init armada37xx_cpufreq_driver_init(void)
 	struct armada_37xx_dvfs *dvfs;
 	struct platform_device *pdev;
 	unsigned long freq;
-	unsigned int cur_frequency;
+	unsigned int cur_frequency, base_frequency;
 	struct regmap *nb_pm_base, *avs_base;
 	struct device *cpu_dev;
 	int load_lvl, ret;
-	struct clk *clk;
+	struct clk *clk, *parent;
 
 	nb_pm_base =
 		syscon_regmap_lookup_by_compatible("marvell,armada-3700-nb-pm");
@@ -399,6 +399,22 @@ static int __init armada37xx_cpufreq_driver_init(void)
 		return PTR_ERR(clk);
 	}
 
+	parent = clk_get_parent(clk);
+	if (IS_ERR(parent)) {
+		dev_err(cpu_dev, "Cannot get parent clock for CPU0\n");
+		clk_put(clk);
+		return PTR_ERR(parent);
+	}
+
+	/* Get parent CPU frequency */
+	base_frequency =  clk_get_rate(parent);
+
+	if (!base_frequency) {
+		dev_err(cpu_dev, "Failed to get parent clock rate for CPU\n");
+		clk_put(clk);
+		return -EINVAL;
+	}
+
 	/* Get nominal (current) CPU frequency */
 	cur_frequency = clk_get_rate(clk);
 	if (!cur_frequency) {
@@ -431,7 +447,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
 	for (load_lvl = ARMADA_37XX_DVFS_LOAD_0; load_lvl < LOAD_LEVEL_NR;
 	     load_lvl++) {
 		unsigned long u_volt = avs_map[dvfs->avs[load_lvl]] * 1000;
-		freq = cur_frequency / dvfs->divider[load_lvl];
+		freq = base_frequency / dvfs->divider[load_lvl];
 		ret = dev_pm_opp_add(cpu_dev, freq, u_volt);
 		if (ret)
 			goto remove_opp;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
index 2b8b892eb846..76ee2de43ea6 100644
@@ -4028,6 +4028,7 @@ static void handle_cursor_update(struct drm_plane *plane,
 	amdgpu_crtc->cursor_width = plane->state->crtc_w;
 	amdgpu_crtc->cursor_height = plane->state->crtc_h;
 
+	memset(&attributes, 0, sizeof(attributes));
 	attributes.address.high_part = upper_32_bits(address);
 	attributes.address.low_part  = lower_32_bits(address);
 	attributes.width             = plane->state->crtc_w;
drivers/gpu/drm/mediatek/mtk_hdmi.c +1 -1
index 643f5edd68fe..62444a3a5742 100644
@@ -1473,7 +1473,6 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
 	if (IS_ERR(regmap))
 		ret = PTR_ERR(regmap);
 	if (ret) {
-		ret = PTR_ERR(regmap);
 		dev_err(dev,
 			"Failed to get system configuration registers: %d\n",
 			ret);
@@ -1509,6 +1508,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
 	of_node_put(remote);
 
 	hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
+	of_node_put(i2c_np);
 	if (!hdmi->ddc_adpt) {
 		dev_err(dev, "Failed to get ddc i2c adapter by node\n");
 		return -EINVAL;
drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c +19 -7
index 340383150fb9..ebf9c96d43ee 100644
@@ -175,6 +175,7 @@ static int hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable)
 		REG_FLD_MOD(core->base, HDMI_CORE_SYS_INTR_UNMASK4, 0, 3, 3);
 		hdmi_wp_clear_irqenable(core->wp, HDMI_IRQ_CORE);
 		hdmi_wp_set_irqstatus(core->wp, HDMI_IRQ_CORE);
+		REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0, 5, 0);
 		hdmi4_core_disable(core);
 		return 0;
 	}
@@ -182,16 +183,24 @@ static int hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable)
 	if (err)
 		return err;
 
+	/*
+	 * Initialize CEC clock divider: CEC needs 2MHz clock hence
+	 * set the divider to 24 to get 48/24=2MHz clock
+	 */
+	REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0x18, 5, 0);
+
 	/* Clear TX FIFO */
 	if (!hdmi_cec_clear_tx_fifo(adap)) {
 		pr_err("cec-%s: could not clear TX FIFO\n", adap->name);
-		return -EIO;
+		err = -EIO;
+		goto err_disable_clk;
 	}
 
 	/* Clear RX FIFO */
 	if (!hdmi_cec_clear_rx_fifo(adap)) {
 		pr_err("cec-%s: could not clear RX FIFO\n", adap->name);
-		return -EIO;
+		err = -EIO;
+		goto err_disable_clk;
 	}
 
 	/* Clear CEC interrupts */
@@ -236,6 +245,12 @@ static int hdmi_cec_adap_enable(struct cec_adapter *adap, bool enable)
 		hdmi_write_reg(core->base, HDMI_CEC_INT_STATUS_1, temp);
 	}
 	return 0;
+
+err_disable_clk:
+	REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0, 5, 0);
+	hdmi4_core_disable(core);
+
+	return err;
 }
 
 static int hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)
@@ -333,11 +348,8 @@ int hdmi4_cec_init(struct platform_device *pdev, struct hdmi_core_data *core,
 		return ret;
 	core->wp = wp;
 
-	/*
-	 * Initialize CEC clock divider: CEC needs 2MHz clock hence
-	 * set the devider to 24 to get 48/24=2MHz clock
-	 */
-	REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0x18, 5, 0);
+	/* Disable clock initially, hdmi_cec_adap_enable() manages it */
+	REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0, 5, 0);
 
 	ret = cec_register_adapter(core->adap, &pdev->dev);
 	if (ret < 0) {
drivers/gpu/drm/sun4i/sun8i_tcon_top.c +3 -2
index adcdf946c365..dfbcd1ad81a5 100644
@@ -217,7 +217,7 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 
 err_unregister_gates:
 	for (i = 0; i < CLK_NUM; i++)
-		if (clk_data->hws[i])
+		if (!IS_ERR_OR_NULL(clk_data->hws[i]))
 			clk_hw_unregister_gate(clk_data->hws[i]);
 	clk_disable_unprepare(tcon_top->bus);
 err_assert_reset:
@@ -235,7 +235,8 @@ static void sun8i_tcon_top_unbind(struct device *dev, struct device *master,
 
 	of_clk_del_provider(dev->of_node);
 	for (i = 0; i < CLK_NUM; i++)
-		clk_hw_unregister_gate(clk_data->hws[i]);
+		if (clk_data->hws[i])
+			clk_hw_unregister_gate(clk_data->hws[i]);
 
 	clk_disable_unprepare(tcon_top->bus);
 	reset_control_assert(tcon_top->rst);
drivers/hv/hv.c +0 -1
index 748a1c4172a6..8e923e70e594 100644
@@ -402,7 +402,6 @@ int hv_synic_cleanup(unsigned int cpu)
 
 		clockevents_unbind_device(hv_cpu->clk_evt, cpu);
 		hv_ce_shutdown(hv_cpu->clk_evt);
-		put_cpu_ptr(hv_cpu);
 	}
 
 	hv_get_synint_state(VMBUS_MESSAGE_SINT, shared_sint.as_uint64);
drivers/hwtracing/intel_th/pci.c +5 -0
index 1cf6290d6435..70f2cb90adc5 100644
@@ -165,6 +165,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x34a6),
 		.driver_data = (kernel_ulong_t)&intel_th_2x,
 	},
+	{
+		/* Comet Lake */
+		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x02a6),
+		.driver_data = (kernel_ulong_t)&intel_th_2x,
+	},
 	{ 0 },
 };
 
drivers/infiniband/hw/hfi1/chip.c +19 -7
index 902d12d6d88b..b12c8ff8ed66 100644
@@ -13388,7 +13388,7 @@ static int set_up_context_variables(struct hfi1_devdata *dd)
 	int total_contexts;
 	int ret;
 	unsigned ngroups;
-	int qos_rmt_count;
+	int rmt_count;
 	int user_rmt_reduced;
 	u32 n_usr_ctxts;
 	u32 send_contexts = chip_send_contexts(dd);
@@ -13450,10 +13450,20 @@ static int set_up_context_variables(struct hfi1_devdata *dd)
 		n_usr_ctxts = rcv_contexts - total_contexts;
 	}
 
-	/* each user context requires an entry in the RMT */
-	qos_rmt_count = qos_rmt_entries(dd, NULL, NULL);
-	if (qos_rmt_count + n_usr_ctxts > NUM_MAP_ENTRIES) {
-		user_rmt_reduced = NUM_MAP_ENTRIES - qos_rmt_count;
+	/*
+	 * The RMT entries are currently allocated as shown below:
+	 * 1. QOS (0 to 128 entries);
+	 * 2. FECN for PSM (num_user_contexts + num_vnic_contexts);
+	 * 3. VNIC (num_vnic_contexts).
+	 * It should be noted that PSM FECN oversubscribe num_vnic_contexts
+	 * entries of RMT because both VNIC and PSM could allocate any receive
+	 * context between dd->first_dyn_alloc_text and dd->num_rcv_contexts,
+	 * and PSM FECN must reserve an RMT entry for each possible PSM receive
+	 * context.
+	 */
+	rmt_count = qos_rmt_entries(dd, NULL, NULL) + (num_vnic_contexts * 2);
+	if (rmt_count + n_usr_ctxts > NUM_MAP_ENTRIES) {
+		user_rmt_reduced = NUM_MAP_ENTRIES - rmt_count;
 		dd_dev_err(dd,
 			   "RMT size is reducing the number of user receive contexts from %u to %d\n",
 			   n_usr_ctxts,
@@ -14441,9 +14451,11 @@ static void init_user_fecn_handling(struct hfi1_devdata *dd,
 	u64 reg;
 	int i, idx, regoff, regidx;
 	u8 offset;
+	u32 total_cnt;
 
 	/* there needs to be enough room in the map table */
-	if (rmt->used + dd->num_user_contexts >= NUM_MAP_ENTRIES) {
+	total_cnt = dd->num_rcv_contexts - dd->first_dyn_alloc_ctxt;
+	if (rmt->used + total_cnt >= NUM_MAP_ENTRIES) {
 		dd_dev_err(dd, "User FECN handling disabled - too many user contexts allocated\n");
 		return;
 	}
@@ -14497,7 +14509,7 @@ static void init_user_fecn_handling(struct hfi1_devdata *dd,
 	/* add rule 1 */
 	add_rsm_rule(dd, RSM_INS_FECN, &rrd);
 
-	rmt->used += dd->num_user_contexts;
+	rmt->used += total_cnt;
 }
 
 /* Initialize RSM for VNIC */
drivers/infiniband/hw/hfi1/rc.c +2 -2
index 6f013a565353..770c78c65730 100644
@@ -2303,7 +2303,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
 			update_ack_queue(qp, next);
 		}
 		e = &qp->s_ack_queue[qp->r_head_ack_queue];
-		if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) {
+		if (e->rdma_sge.mr) {
 			rvt_put_mr(e->rdma_sge.mr);
 			e->rdma_sge.mr = NULL;
 		}
@@ -2377,7 +2377,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
 			update_ack_queue(qp, next);
 		}
 		e = &qp->s_ack_queue[qp->r_head_ack_queue];
-		if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) {
+		if (e->rdma_sge.mr) {
 			rvt_put_mr(e->rdma_sge.mr);
 			e->rdma_sge.mr = NULL;
 		}
drivers/infiniband/hw/hns/hns_roce_hem.c +4 -2
index f6faefed96e8..a73d388b7093 100644
@@ -745,6 +745,8 @@ void *hns_roce_table_find(struct hns_roce_dev *hr_dev,
 		idx_offset = (obj & (table->num_obj - 1)) % obj_per_chunk;
 		dma_offset = offset = idx_offset * table->obj_size;
 	} else {
+		u32 seg_size = 64; /* 8 bytes per BA and 8 BA per segment */
+
 		hns_roce_calc_hem_mhop(hr_dev, table, &mhop_obj, &mhop);
 		/* mtt mhop */
 		i = mhop.l0_idx;
@@ -756,8 +758,8 @@ void *hns_roce_table_find(struct hns_roce_dev *hr_dev,
 			hem_idx = i;
 
 		hem = table->hem[hem_idx];
-		dma_offset = offset = (obj & (table->num_obj - 1)) *
-				       table->obj_size % mhop.bt_chunk_size;
+		dma_offset = offset = (obj & (table->num_obj - 1)) * seg_size %
+				       mhop.bt_chunk_size;
 		if (mhop.hop_num == 2)
 			dma_offset = offset = 0;
 	}
drivers/infiniband/hw/hns/hns_roce_mr.c +2 -2
index eb26a5f6fc58..41a538d23b80 100644
@@ -707,7 +707,6 @@ static int hns_roce_write_mtt_chunk(struct hns_roce_dev *hr_dev,
 	struct hns_roce_hem_table *table;
 	dma_addr_t dma_handle;
 	__le64 *mtts;
-	u32 s = start_index * sizeof(u64);
 	u32 bt_page_size;
 	u32 i;
 
@@ -730,7 +729,8 @@ static int hns_roce_write_mtt_chunk(struct hns_roce_dev *hr_dev,
 		table = &hr_dev->mr_table.mtt_cqe_table;
 
 	mtts = hns_roce_table_find(hr_dev, table,
-				mtt->first_seg + s / hr_dev->caps.mtt_entry_sz,
+				mtt->first_seg +
+				start_index / HNS_ROCE_MTT_ENTRY_PER_SEG,
 				&dma_handle);
 	if (!mtts)
 		return -ENOMEM;
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +2 -0
index a5719899f49a..ed99f0a08dc4 100644
@@ -1123,6 +1123,8 @@ static void pvrdma_pci_remove(struct pci_dev *pdev)
 	pvrdma_page_dir_cleanup(dev, &dev->cq_pdir);
 	pvrdma_page_dir_cleanup(dev, &dev->async_pdir);
 	pvrdma_free_slots(dev);
+	dma_free_coherent(&pdev->dev, sizeof(*dev->dsr), dev->dsr,
+			  dev->dsrbase);
 
 	iounmap(dev->regs);
 	kfree(dev->sgid_tbl);
drivers/iommu/amd_iommu_init.c +1 -1
index be3801d43d48..3a1d30304f7e 100644
@@ -356,7 +356,7 @@ static void iommu_write_l2(struct amd_iommu *iommu, u8 address, u32 val)
 static void iommu_set_exclusion_range(struct amd_iommu *iommu)
 {
 	u64 start = iommu->exclusion_start & PAGE_MASK;
-	u64 limit = (start + iommu->exclusion_length) & PAGE_MASK;
+	u64 limit = (start + iommu->exclusion_length - 1) & PAGE_MASK;
 	u64 entry;
 
 	if (!iommu->exclusion_start)
drivers/net/ethernet/stmicro/stmmac/norm_desc.c +1 -1
index b7dd4e3c760d..6d690678c20e 100644
@@ -140,7 +140,7 @@ static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode,
 	p->des0 |= cpu_to_le32(RDES0_OWN);
 
 	bfsize1 = min(bfsize, BUF_SIZE_2KiB - 1);
-	p->des1 |= cpu_to_le32(bfsize & RDES1_BUFFER1_SIZE_MASK);
+	p->des1 |= cpu_to_le32(bfsize1 & RDES1_BUFFER1_SIZE_MASK);
 
 	if (mode == STMMAC_CHAIN_MODE)
 		ndesc_rx_set_on_chain(p, end);
drivers/nvme/host/fc.c +15 -5
index 9375fa705d82..67dec8860bf3 100644
@@ -1844,7 +1844,7 @@ nvme_fc_init_queue(struct nvme_fc_ctrl *ctrl, int idx)
 	memset(queue, 0, sizeof(*queue));
 	queue->ctrl = ctrl;
 	queue->qnum = idx;
-	atomic_set(&queue->csn, 1);
+	atomic_set(&queue->csn, 0);
 	queue->dev = ctrl->dev;
 
 	if (idx > 0)
@@ -1886,7 +1886,7 @@ nvme_fc_free_queue(struct nvme_fc_queue *queue)
 	 */
 
 	queue->connection_id = 0;
-	atomic_set(&queue->csn, 1);
+	atomic_set(&queue->csn, 0);
 }
 
 static void
@@ -2182,7 +2182,6 @@ nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,
 {
 	struct nvme_fc_cmd_iu *cmdiu = &op->cmd_iu;
 	struct nvme_command *sqe = &cmdiu->sqe;
-	u32 csn;
 	int ret, opstate;
 
 	/*
@@ -2197,8 +2196,6 @@ nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,
 
 	/* format the FC-NVME CMD IU and fcp_req */
 	cmdiu->connection_id = cpu_to_be64(queue->connection_id);
-	csn = atomic_inc_return(&queue->csn);
-	cmdiu->csn = cpu_to_be32(csn);
 	cmdiu->data_len = cpu_to_be32(data_len);
 	switch (io_dir) {
 	case NVMEFC_FCP_WRITE:
@@ -2256,11 +2253,24 @@ nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,
 	if (!(op->flags & FCOP_FLAGS_AEN))
 		blk_mq_start_request(op->rq);
 
+	cmdiu->csn = cpu_to_be32(atomic_inc_return(&queue->csn));
 	ret = ctrl->lport->ops->fcp_io(&ctrl->lport->localport,
 					&ctrl->rport->remoteport,
 					queue->lldd_handle, &op->fcp_req);
 
 	if (ret) {
+		/*
+		 * If the lld fails to send the command is there an issue with
+		 * the csn value?  If the command that fails is the Connect,
+		 * no - as the connection won't be live.  If it is a command
+		 * post-connect, it's possible a gap in csn may be created.
+		 * Does this matter?  As Linux initiators don't send fused
+		 * commands, no.  The gap would exist, but as there's nothing
+		 * that depends on csn order to be delivered on the target
+		 * side, it shouldn't hurt.  It would be difficult for a
+		 * target to even detect the csn gap as it has no idea when the
+		 * cmd with the csn was supposed to arrive.
+		 */
 		opstate = atomic_xchg(&op->state, FCPOP_STATE_COMPLETE);
 		__nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate);
 
drivers/platform/x86/pmc_atom.c +1 -1
index eaec2d306481..c7039f52ad51 100644
@@ -396,7 +396,7 @@ static int pmc_dbgfs_register(struct pmc_dev *pmc)
  * Some systems need one or more of their pmc_plt_clks to be
  * marked as critical.
  */
-static const struct dmi_system_id critclk_systems[] __initconst = {
+static const struct dmi_system_id critclk_systems[] = {
 	{
 		.ident = "MPL CEC1x",
 		.matches = {
drivers/scsi/csiostor/csio_scsi.c +4 -1
index dab0d3f9bee1..e09c7f360dbd 100644
@@ -1713,8 +1713,11 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req)
 	}
 
 out:
-	if (req->nsge > 0)
+	if (req->nsge > 0) {
 		scsi_dma_unmap(cmnd);
+		if (req->dcopy && (host_status == DID_OK))
+			host_status = csio_scsi_copy_to_sgl(hw, req);
+	}
 
 	cmnd->result = (((host_status) << 16) | scsi_status);
 	cmnd->scsi_done(cmnd);
drivers/scsi/libsas/sas_expander.c +4 -5
index a1551ab33616..e9ecc667e3fb 100644
@@ -48,17 +48,16 @@ static void smp_task_timedout(struct timer_list *t)
 	unsigned long flags;
 
 	spin_lock_irqsave(&task->task_state_lock, flags);
-	if (!(task->task_state_flags & SAS_TASK_STATE_DONE))
+	if (!(task->task_state_flags & SAS_TASK_STATE_DONE)) {
 		task->task_state_flags |= SAS_TASK_STATE_ABORTED;
+		complete(&task->slow_task->completion);
+	}
 	spin_unlock_irqrestore(&task->task_state_lock, flags);
-
-	complete(&task->slow_task->completion);
 }
 
 static void smp_task_done(struct sas_task *task)
 {
-	if (!del_timer(&task->slow_task->timer))
-		return;
+	del_timer(&task->slow_task->timer);
 	complete(&task->slow_task->completion);
 }
 
drivers/scsi/lpfc/lpfc_attr.c +92 -88

579 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_ct.c +6 -6
index 1cbdc892ff95..1a964e71582f 100644
@@ -1220,7 +1220,7 @@ lpfc_vport_symbolic_port_name(struct lpfc_vport *vport, char *symbol,
 	 * Name object.  NPIV is not in play so this integer
 	 * value is sufficient and unique per FC-ID.
 	 */
-	n = snprintf(symbol, size, "%d", vport->phba->brd_no);
+	n = scnprintf(symbol, size, "%d", vport->phba->brd_no);
 	return n;
 }
 
@@ -1234,26 +1234,26 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol,
 
 	lpfc_decode_firmware_rev(vport->phba, fwrev, 0);
 
-	n = snprintf(symbol, size, "Emulex %s", vport->phba->ModelName);
+	n = scnprintf(symbol, size, "Emulex %s", vport->phba->ModelName);
 	if (size < n)
 		return n;
 
-	n += snprintf(symbol + n, size - n, " FV%s", fwrev);
+	n += scnprintf(symbol + n, size - n, " FV%s", fwrev);
 	if (size < n)
 		return n;
 
-	n += snprintf(symbol + n, size - n, " DV%s.",
+	n += scnprintf(symbol + n, size - n, " DV%s.",
 		      lpfc_release_version);
 	if (size < n)
 		return n;
 
-	n += snprintf(symbol + n, size - n, " HN:%s.",
+	n += scnprintf(symbol + n, size - n, " HN:%s.",
 		      init_utsname()->nodename);
 	if (size < n)
 		return n;
 
 	/* Note :- OS name is "Linux" */
-	n += snprintf(symbol + n, size - n, " OS:%s\n",
+	n += scnprintf(symbol + n, size - n, " OS:%s\n",
 		      init_utsname()->sysname);
 	return n;
 }
drivers/scsi/lpfc/lpfc_debugfs.c +228 -225

1,384 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_debugfs.h +3 -3
index 30efc7bf91bd..824de3e410ca 100644
@@ -342,7 +342,7 @@ lpfc_debug_dump_qe(struct lpfc_queue *q, uint32_t idx)
 	pword = q->qe[idx].address;
 
 	len = 0;
-	len += snprintf(line_buf+len, LPFC_LBUF_SZ-len, "QE[%04d]: ", idx);
+	len += scnprintf(line_buf+len, LPFC_LBUF_SZ-len, "QE[%04d]: ", idx);
 	if (qe_word_cnt > 8)
 		printk(KERN_ERR "%s\n", line_buf);
 
@@ -353,11 +353,11 @@ lpfc_debug_dump_qe(struct lpfc_queue *q, uint32_t idx)
 			if (qe_word_cnt > 8) {
 				len = 0;
 				memset(line_buf, 0, LPFC_LBUF_SZ);
-				len += snprintf(line_buf+len, LPFC_LBUF_SZ-len,
+				len += scnprintf(line_buf+len, LPFC_LBUF_SZ-len,
 						"%03d: ", i);
 			}
 		}
-		len += snprintf(line_buf+len, LPFC_LBUF_SZ-len, "%08x ",
+		len += scnprintf(line_buf+len, LPFC_LBUF_SZ-len, "%08x ",
 				((uint32_t)*pword) & 0xffffffff);
 		pword++;
 	}
drivers/scsi/qla2xxx/qla_attr.c +2 -2
index 4888b999e82f..f8f4d3ea67f3 100644
@@ -345,7 +345,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
 		}
 
 		ha->optrom_region_start = start;
-		ha->optrom_region_size = start + size;
+		ha->optrom_region_size = size;
 
 		ha->optrom_state = QLA_SREADING;
 		ha->optrom_buffer = vmalloc(ha->optrom_region_size);
@@ -418,7 +418,7 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
 		}
 
 		ha->optrom_region_start = start;
-		ha->optrom_region_size = start + size;
+		ha->optrom_region_size = size;
 
 		ha->optrom_state = QLA_SWRITING;
 		ha->optrom_buffer = vmalloc(ha->optrom_region_size);
drivers/scsi/qla2xxx/qla_target.c +2 -2
index d2888b30a8a3..a8c67cd17625 100644
@@ -981,6 +981,8 @@ void qlt_free_session_done(struct work_struct *work)
 		sess->send_els_logo);
 
 	if (!IS_SW_RESV_ADDR(sess->d_id)) {
+		qla2x00_mark_device_lost(vha, sess, 0, 0);
+
 		if (sess->send_els_logo) {
 			qlt_port_logo_t logo;
 
@@ -1161,8 +1163,6 @@ void qlt_unreg_sess(struct fc_port *sess)
 	if (sess->se_sess)
 		vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess);
 
-	qla2x00_mark_device_lost(vha, sess, 0, 0);
-
 	sess->deleted = QLA_SESS_DELETION_IN_PROGRESS;
 	sess->disc_state = DSC_DELETE_PEND;
 	sess->last_rscn_gen = sess->rscn_gen;
drivers/soc/sunxi/Kconfig +1 -0
index 353b07e40176..e84eb4e59f58 100644
@@ -4,6 +4,7 @@
 config SUNXI_SRAM
 	bool
 	default ARCH_SUNXI
+	select REGMAP_MMIO
 	help
 	  Say y here to enable the SRAM controller support. This
 	  device is responsible on mapping the SRAM in the sunXi SoCs
drivers/staging/greybus/power_supply.c +1 -1
index 0529e5628c24..ae5c0285a942 100644
@@ -520,7 +520,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy)
 
 	op = gb_operation_create(connection,
 				 GB_POWER_SUPPLY_TYPE_GET_PROP_DESCRIPTORS,
-				 sizeof(req), sizeof(*resp) + props_count *
+				 sizeof(*req), sizeof(*resp) + props_count *
 				 sizeof(struct gb_power_supply_props_desc),
 				 GFP_KERNEL);
 	if (!op)
drivers/staging/most/cdev/cdev.c +1 -1
index 4569838f27a0..0b48677fa958 100644
@@ -546,7 +546,7 @@ static void __exit mod_exit(void)
 		destroy_cdev(c);
 		destroy_channel(c);
 	}
-	unregister_chrdev_region(comp.devno, 1);
+	unregister_chrdev_region(comp.devno, CHRDEV_REGION_SIZE);
 	ida_destroy(&comp.minor_id);
 	class_destroy(comp.class);
 }
drivers/usb/class/cdc-acm.c +25 -7
index 32da5a4182ac..5b442bc68a76 100644
@@ -470,12 +470,12 @@ static void acm_read_bulk_callback(struct urb *urb)
 	struct acm *acm = rb->instance;
 	unsigned long flags;
 	int status = urb->status;
+	bool stopped = false;
+	bool stalled = false;
 
 	dev_vdbg(&acm->data->dev, "got urb %d, len %d, status %d\n",
 		rb->index, urb->actual_length, status);
 
-	set_bit(rb->index, &acm->read_urbs_free);
-
 	if (!acm->dev) {
 		dev_dbg(&acm->data->dev, "%s - disconnected\n", __func__);
 		return;
@@ -488,15 +488,16 @@ static void acm_read_bulk_callback(struct urb *urb)
 		break;
 	case -EPIPE:
 		set_bit(EVENT_RX_STALL, &acm->flags);
-		schedule_work(&acm->work);
-		return;
+		stalled = true;
+		break;
 	case -ENOENT:
 	case -ECONNRESET:
 	case -ESHUTDOWN:
 		dev_dbg(&acm->data->dev,
 			"%s - urb shutting down with status: %d\n",
 			__func__, status);
-		return;
+		stopped = true;
+		break;
 	default:
 		dev_dbg(&acm->data->dev,
 			"%s - nonzero urb status received: %d\n",
@@ -505,10 +506,24 @@ static void acm_read_bulk_callback(struct urb *urb)
 	}
 
 	/*
-	 * Unthrottle may run on another CPU which needs to see events
-	 * in the same order. Submission has an implict barrier
+	 * Make sure URB processing is done before marking as free to avoid
+	 * racing with unthrottle() on another CPU. Matches the barriers
+	 * implied by the test_and_clear_bit() in acm_submit_read_urb().
 	 */
 	smp_mb__before_atomic();
+	set_bit(rb->index, &acm->read_urbs_free);
+	/*
+	 * Make sure URB is marked as free before checking the throttled flag
+	 * to avoid racing with unthrottle() on another CPU. Matches the
+	 * smp_mb() in unthrottle().
+	 */
+	smp_mb__after_atomic();
+
+	if (stopped || stalled) {
+		if (stalled)
+			schedule_work(&acm->work);
+		return;
+	}
 
 	/* throttle device if requested by tty */
 	spin_lock_irqsave(&acm->read_lock, flags);
@@ -842,6 +857,9 @@ static void acm_tty_unthrottle(struct tty_struct *tty)
 	acm->throttle_req = 0;
 	spin_unlock_irq(&acm->read_lock);
 
+	/* Matches the smp_mb__after_atomic() in acm_read_bulk_callback(). */
+	smp_mb();
+
 	if (was_throttled)
 		acm_submit_read_urbs(acm, GFP_KERNEL);
 }
drivers/usb/dwc3/core.c +1 -1
index fec97465ccac..4d5c7dda8f54 100644
@@ -1214,7 +1214,7 @@ static void dwc3_get_properties(struct dwc3 *dwc)
 	u8			tx_max_burst_prd;
 
 	/* default to highest possible threshold */
-	lpm_nyet_threshold = 0xff;
+	lpm_nyet_threshold = 0xf;
 
 	/* default to -3.5dB de-emphasis */
 	tx_de_emphasis = 1;
drivers/usb/musb/Kconfig +1 -1
index ad08895e78f9..c3dae7d5cb6e 100644
@@ -66,7 +66,7 @@ config USB_MUSB_SUNXI
 	depends on NOP_USB_XCEIV
 	depends on PHY_SUN4I_USB
 	depends on EXTCON
-	depends on GENERIC_PHY
+	select GENERIC_PHY
 	select SUNXI_SRAM
 
 config USB_MUSB_DAVINCI
drivers/usb/serial/f81232.c +39 -0
index 96036f87b1de..087e5f1656f8 100644
@@ -556,9 +556,12 @@ static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port)
 
 static void f81232_close(struct usb_serial_port *port)
 {
+	struct f81232_private *port_priv = usb_get_serial_port_data(port);
+
 	f81232_port_disable(port);
 	usb_serial_generic_close(port);
 	usb_kill_urb(port->interrupt_in_urb);
+	flush_work(&port_priv->interrupt_work);
 }
 
 static void f81232_dtr_rts(struct usb_serial_port *port, int on)
@@ -652,6 +655,40 @@ static int f81232_port_remove(struct usb_serial_port *port)
 	return 0;
 }
 
+static int f81232_suspend(struct usb_serial *serial, pm_message_t message)
+{
+	struct usb_serial_port *port = serial->port[0];
+	struct f81232_private *port_priv = usb_get_serial_port_data(port);
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i)
+		usb_kill_urb(port->read_urbs[i]);
+
+	usb_kill_urb(port->interrupt_in_urb);
+
+	if (port_priv)
+		flush_work(&port_priv->interrupt_work);
+
+	return 0;
+}
+
+static int f81232_resume(struct usb_serial *serial)
+{
+	struct usb_serial_port *port = serial->port[0];
+	int result;
+
+	if (tty_port_initialized(&port->port)) {
+		result = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
+		if (result) {
+			dev_err(&port->dev, "submit interrupt urb failed: %d\n",
+					result);
+			return result;
+		}
+	}
+
+	return usb_serial_generic_resume(serial);
+}
+
 static struct usb_serial_driver f81232_device = {
 	.driver = {
 		.owner =	THIS_MODULE,
@@ -675,6 +712,8 @@ static struct usb_serial_driver f81232_device = {
 	.read_int_callback =	f81232_read_int_callback,
 	.port_probe =		f81232_port_probe,
 	.port_remove =		f81232_port_remove,
+	.suspend =		f81232_suspend,
+	.resume =		f81232_resume,
 };
 
 static struct usb_serial_driver * const serial_drivers[] = {
drivers/usb/storage/scsiglue.c +12 -14
index 101ebac43c87..59d82b45e758 100644
@@ -65,6 +65,7 @@ static const char* host_info(struct Scsi_Host *host)
 static int slave_alloc (struct scsi_device *sdev)
 {
 	struct us_data *us = host_to_us(sdev->host);
+	int maxp;
 
 	/*
 	 * Set the INQUIRY transfer length to 36.  We don't use any of
@@ -74,20 +75,17 @@ static int slave_alloc (struct scsi_device *sdev)
 	sdev->inquiry_len = 36;
 
 	/*
-	 * USB has unusual DMA-alignment requirements: Although the
-	 * starting address of each scatter-gather element doesn't matter,
-	 * the length of each element except the last must be divisible
-	 * by the Bulk maxpacket value.  There's currently no way to
-	 * express this by block-layer constraints, so we'll cop out
-	 * and simply require addresses to be aligned at 512-byte
-	 * boundaries.  This is okay since most block I/O involves
-	 * hardware sectors that are multiples of 512 bytes in length,
-	 * and since host controllers up through USB 2.0 have maxpacket
-	 * values no larger than 512.
-	 *
-	 * But it doesn't suffice for Wireless USB, where Bulk maxpacket
-	 * values can be as large as 2048.  To make that work properly
-	 * will require changes to the block layer.
+	 * USB has unusual scatter-gather requirements: the length of each
+	 * scatterlist element except the last must be divisible by the
+	 * Bulk maxpacket value.  Fortunately this value is always a
+	 * power of 2.  Inform the block layer about this requirement.
+	 */
+	maxp = usb_maxpacket(us->pusb_dev, us->recv_bulk_pipe, 0);
+	blk_queue_virt_boundary(sdev->request_queue, maxp - 1);
+
+	/*
+	 * Some host controllers may have alignment requirements.
+	 * We'll play it safe by requiring 512-byte alignment always.
 	 */
 	blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1));
 
drivers/usb/storage/uas.c +22 -13
index 1f7b401c4d04..5b1d09367475 100644
@@ -796,24 +796,33 @@ static int uas_slave_alloc(struct scsi_device *sdev)
 {
 	struct uas_dev_info *devinfo =
 		(struct uas_dev_info *)sdev->host->hostdata;
+	int maxp;
 
 	sdev->hostdata = devinfo;
 
 	/*
-	 * USB has unusual DMA-alignment requirements: Although the
-	 * starting address of each scatter-gather element doesn't matter,
-	 * the length of each element except the last must be divisible
-	 * by the Bulk maxpacket value.  There's currently no way to
-	 * express this by block-layer constraints, so we'll cop out
-	 * and simply require addresses to be aligned at 512-byte
-	 * boundaries.  This is okay since most block I/O involves
-	 * hardware sectors that are multiples of 512 bytes in length,
-	 * and since host controllers up through USB 2.0 have maxpacket
-	 * values no larger than 512.
+	 * We have two requirements here. We must satisfy the requirements
+	 * of the physical HC and the demands of the protocol, as we
+	 * definitely want no additional memory allocation in this path
+	 * ruling out using bounce buffers.
 	 *
-	 * But it doesn't suffice for Wireless USB, where Bulk maxpacket
-	 * values can be as large as 2048.  To make that work properly
-	 * will require changes to the block layer.
+	 * For a transmission on USB to continue we must never send
+	 * a package that is smaller than maxpacket. Hence the length of each
+         * scatterlist element except the last must be divisible by the
+         * Bulk maxpacket value.
+	 * If the HC does not ensure that through SG,
+	 * the upper layer must do that. We must assume nothing
+	 * about the capabilities off the HC, so we use the most
+	 * pessimistic requirement.
+	 */
+
+	maxp = usb_maxpacket(devinfo->udev, devinfo->data_in_pipe, 0);
+	blk_queue_virt_boundary(sdev->request_queue, maxp - 1);
+
+	/*
+	 * The protocol has no requirements on alignment in the strict sense.
+	 * Controllers may or may not have alignment restrictions.
+	 * As this is not exported, we use an extremely conservative guess.
 	 */
 	blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1));
 
drivers/virtio/virtio_pci_common.c +5 -3
index 465a6f5142cc..45b04bc91f24 100644
@@ -255,9 +255,11 @@ void vp_del_vqs(struct virtio_device *vdev)
 	for (i = 0; i < vp_dev->msix_used_vectors; ++i)
 		free_irq(pci_irq_vector(vp_dev->pci_dev, i), vp_dev);
 
-	for (i = 0; i < vp_dev->msix_vectors; i++)
-		if (vp_dev->msix_affinity_masks[i])
-			free_cpumask_var(vp_dev->msix_affinity_masks[i]);
+	if (vp_dev->msix_affinity_masks) {
+		for (i = 0; i < vp_dev->msix_vectors; i++)
+			if (vp_dev->msix_affinity_masks[i])
+				free_cpumask_var(vp_dev->msix_affinity_masks[i]);
+	}
 
 	if (vp_dev->msix_enabled) {
 		/* Disable the vector used for configuration */
include/linux/kernel.h +2 -2
index d6aac75b51ba..3d83ebb302cf 100644
@@ -73,8 +73,8 @@
 
 #define u64_to_user_ptr(x) (		\
 {					\
-	typecheck(u64, x);		\
-	(void __user *)(uintptr_t)x;	\
+	typecheck(u64, (x));		\
+	(void __user *)(uintptr_t)(x);	\
 }					\
 )
 
include/net/bluetooth/hci_core.h +3 -0
index 1dfb75057580..cc2d0c3b475b 100644
@@ -182,6 +182,9 @@ struct adv_info {
 
 #define HCI_MAX_SHORT_NAME_LENGTH	10
 
+/* Min encryption key size to match with SMP */
+#define HCI_MIN_ENC_KEY_SIZE		7
+
 /* Default LE RPA expiry time, 15 minutes */
 #define HCI_DEFAULT_RPA_TIMEOUT		(15 * 60)
 
kernel/events/core.c +43 -9

84 lines not on this page · raw message

kernel/events/ring_buffer.c +2 -2
index 474b2ccdbe69..99c7f199f2d4 100644
@@ -393,7 +393,7 @@ void *perf_aux_output_begin(struct perf_output_handle *handle,
 		 * store that will be enabled on successful return
 		 */
 		if (!handle->size) { /* A, matches D */
-			event->pending_disable = 1;
+			event->pending_disable = smp_processor_id();
 			perf_output_wakeup(handle);
 			local_set(&rb->aux_nest, 0);
 			goto err_put;
@@ -471,7 +471,7 @@ void perf_aux_output_end(struct perf_output_handle *handle, unsigned long size)
 
 	if (wakeup) {
 		if (handle->aux_flags & PERF_AUX_FLAG_TRUNCATED)
-			handle->event->pending_disable = 1;
+			handle->event->pending_disable = smp_processor_id();
 		perf_output_wakeup(handle);
 	}
 
kernel/futex.c +117 -71

8 lines not on this page · raw message

kernel/irq/manage.c +3 -1
index 5c0ba5ca5930..cd4f9f3e8345 100644

Lines of this file are not shown. View the raw message.

lib/ubsan.c +23 -26

49 lines not on this page · raw message

mm/slab.c +2 -1
index b8e0ec74330f..018d32496e8d 100644

Lines of this file are not shown. View the raw message.

net/bluetooth/hci_conn.c +8 -0
index bd4978ce8c45..3cf0764d5793 100644

Lines of this file are not shown. View the raw message.

net/bluetooth/hidp/sock.c +1 -0
index 1eaac01f85de..7f36fa73ffee 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/cs35l35.c +11 -0
index bd6226bde45f..17e0101081ef 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/cs4270.c +1 -0
index 3c266eeb89bf..007ce9f48e44 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/hdmi-codec.c +59 -59

118 lines not on this page · raw message

sound/soc/codecs/nau8810.c +2 -2
index bfd74b86c9d2..645aa0794123 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/nau8824.c +38 -8

46 lines not on this page · raw message

sound/soc/codecs/rt5682.c +5 -9
index 79ebcc239786..6f5dac09cede 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/tlv320aic32x4.c +2 -0
index f03195d2ab2e..45d9f4a09044 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/tlv320aic3x.c +3 -2
index 6a271e6e6b8f..6c0a3dad44b8 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/wm_adsp.c +8 -3
index a651fed62a27..ee85056a8577 100644

Lines of this file are not shown. View the raw message.

sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +1 -1
index a892b37eab7c..b8a03f58ac8c 100644

Lines of this file are not shown. View the raw message.

sound/soc/intel/common/sst-firmware.c +6 -2
index 11041aedea31..6cfcc1042989 100644

Lines of this file are not shown. View the raw message.

sound/soc/intel/skylake/skl-pcm.c +14 -5
index 823e39103edd..6b2c8c6e7a00 100644

Lines of this file are not shown. View the raw message.

sound/soc/rockchip/rockchip_pdm.c +2 -0
index 400e29edb1c9..8a2e3bbce3a1 100644

Lines of this file are not shown. View the raw message.

sound/soc/samsung/odroid.c +2 -2
index e7b371b07230..45c6d7396785 100644

Lines of this file are not shown. View the raw message.

sound/soc/soc-dapm.c +4 -0
index 9b78fb3daa7b..2257b1b0151c 100644

Lines of this file are not shown. View the raw message.

sound/soc/soc-pcm.c +5 -2
index e8b98bfd4cf1..33060af18b5a 100644

Lines of this file are not shown. View the raw message.

sound/soc/stm/stm32_adfsdm.c +34 -4
index 706ff005234f..24948b95eb19 100644

Lines of this file are not shown. View the raw message.

sound/soc/stm/stm32_sai_sub.c +12 -3
index 85c4b6d8e89d..2fb2b914e78b 100644

Lines of this file are not shown. View the raw message.

tools/objtool/check.c +1 -0
index 550f17611bd7..ef152daccc33 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.