From 33d74f8aeeb419356a97f81a40c60f76222112af Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 23 Jun 2019 20:33:19 -0400 Subject: [PATCH] fixes for 4.14 Signed-off-by: Sasha Levin --- queue-4.14/arc-fix-build-warnings.patch | 99 +++++++++++++++++ ...d-missing-fifo-size-entry-in-gmac-no.patch | 39 +++++++ ...d-missing-multicast-filter-bins-numb.patch | 39 +++++++ ...m-hdlcd-actually-validate-crtc-modes.patch | 63 +++++++++++ ...hdlcd-allow-a-bit-of-clock-tolerance.patch | 39 +++++++ ...hermal-sensors-only-if-dev-of_node-i.patch | 62 +++++++++++ ...-treat-parameters-as-paged-if-on-mul.patch | 101 ++++++++++++++++++ ...reeze_work-work_struct-is-canceled-o.patch | 38 +++++++ ...-page-aligned-for-a-given-virtual-ad.patch | 41 +++++++ ...avt-correct-ibv_devinfo-max_mr-value.patch | 66 ++++++++++++ .../ib-rdmavt-fix-alloc_qpn-warn_on.patch | 57 ++++++++++ ...ing-check-bug-in-get_vdev_port_node_.patch | 34 ++++++ ...remove-set-but-not-used-variable-epc.patch | 43 ++++++++ ...x-avoid-error-message-on-remove-from.patch | 48 +++++++++ ...iatek-use-hw_feature-to-judge-if-hwl.patch | 70 ++++++++++++ ...iatek-use-net_ip_align-to-judge-if-h.patch | 43 ++++++++ ...loopback-test-failed-at-copper-ports.patch | 45 ++++++++ ...pvlan-device-tso-disabled-while-neti.patch | 45 ++++++++ ...rflow-in-the-number-of-namespace-lis.patch | 37 +++++++ ...ler-warnings-in-float-emulation-code.patch | 53 +++++++++ ...m-leak-in-parport_register_dev_model.patch | 67 ++++++++++++ ...an-attribute-in-bridge_hostnotify-ud.patch | 51 +++++++++ ...ck.pl-fix-arm64-wrong-or-unknown-arc.patch | 42 ++++++++ ...lock-on-error-in-pqi_submit_raid_req.patch | 39 +++++++ ...hat-space-was-properly-alloced-in-co.patch | 42 ++++++++ queue-4.14/series | 27 +++++ ...pdated-event-period-in-response-to-p.patch | 44 ++++++++ ...on-mismatch-between-memblock_reserve.patch | 50 +++++++++ 28 files changed, 1424 insertions(+) create mode 100644 queue-4.14/arc-fix-build-warnings.patch create mode 100644 queue-4.14/arc-plat-hsdk-add-missing-fifo-size-entry-in-gmac-no.patch create mode 100644 queue-4.14/arc-plat-hsdk-add-missing-multicast-filter-bins-numb.patch create mode 100644 queue-4.14/drm-arm-hdlcd-actually-validate-crtc-modes.patch create mode 100644 queue-4.14/drm-arm-hdlcd-allow-a-bit-of-clock-tolerance.patch create mode 100644 queue-4.14/hwmon-core-add-thermal-sensors-only-if-dev-of_node-i.patch create mode 100644 queue-4.14/hwmon-pmbus-core-treat-parameters-as-paged-if-on-mul.patch create mode 100644 queue-4.14/ib-hfi1-insure-freeze_work-work_struct-is-canceled-o.patch create mode 100644 queue-4.14/ib-hfi1-validate-page-aligned-for-a-given-virtual-ad.patch create mode 100644 queue-4.14/ib-qib-hfi1-rdmavt-correct-ibv_devinfo-max_mr-value.patch create mode 100644 queue-4.14/ib-rdmavt-fix-alloc_qpn-warn_on.patch create mode 100644 queue-4.14/mdesc-fix-a-missing-check-bug-in-get_vdev_port_node_.patch create mode 100644 queue-4.14/mips-uprobes-remove-set-but-not-used-variable-epc.patch create mode 100644 queue-4.14/net-dsa-mv88e6xxx-avoid-error-message-on-remove-from.patch create mode 100644 queue-4.14/net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch create mode 100644 queue-4.14/net-ethernet-mediatek-use-net_ip_align-to-judge-if-h.patch create mode 100644 queue-4.14/net-hns-fix-loopback-test-failed-at-copper-ports.patch create mode 100644 queue-4.14/net-ipvlan-fix-ipvlan-device-tso-disabled-while-neti.patch create mode 100644 queue-4.14/nvme-fix-u32-overflow-in-the-number-of-namespace-lis.patch create mode 100644 queue-4.14/parisc-fix-compiler-warnings-in-float-emulation-code.patch create mode 100644 queue-4.14/parport-fix-mem-leak-in-parport_register_dev_model.patch create mode 100644 queue-4.14/s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-ud.patch create mode 100644 queue-4.14/scripts-checkstack.pl-fix-arm64-wrong-or-unknown-arc.patch create mode 100644 queue-4.14/scsi-smartpqi-unlock-on-error-in-pqi_submit_raid_req.patch create mode 100644 queue-4.14/scsi-ufs-check-that-space-was-properly-alloced-in-co.patch create mode 100644 queue-4.14/sparc-perf-fix-updated-event-period-in-response-to-p.patch create mode 100644 queue-4.14/xtensa-fix-section-mismatch-between-memblock_reserve.patch diff --git a/queue-4.14/arc-fix-build-warnings.patch b/queue-4.14/arc-fix-build-warnings.patch new file mode 100644 index 0000000000..33dc9b4aeb --- /dev/null +++ b/queue-4.14/arc-fix-build-warnings.patch @@ -0,0 +1,99 @@ +From c9426cce5b2d967299248c6e20d89361e5ee9154 Mon Sep 17 00:00:00 2001 +From: Vineet Gupta +Date: Tue, 7 May 2019 10:45:24 -0700 +Subject: ARC: fix build warnings + +[ Upstream commit 89c92142f75eb80064f5b9f1111484b1b4d81790 ] + +| arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla] +| arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value] + +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/include/asm/cmpxchg.h | 14 ++++++++++---- + arch/arc/mm/tlb.c | 13 ++++++++----- + 2 files changed, 18 insertions(+), 9 deletions(-) + +diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h +index d819de1c5d10..3ea4112c8302 100644 +--- a/arch/arc/include/asm/cmpxchg.h ++++ b/arch/arc/include/asm/cmpxchg.h +@@ -92,8 +92,11 @@ __cmpxchg(volatile void *ptr, unsigned long expected, unsigned long new) + + #endif /* CONFIG_ARC_HAS_LLSC */ + +-#define cmpxchg(ptr, o, n) ((typeof(*(ptr)))__cmpxchg((ptr), \ +- (unsigned long)(o), (unsigned long)(n))) ++#define cmpxchg(ptr, o, n) ({ \ ++ (typeof(*(ptr)))__cmpxchg((ptr), \ ++ (unsigned long)(o), \ ++ (unsigned long)(n)); \ ++}) + + /* + * atomic_cmpxchg is same as cmpxchg +@@ -198,8 +201,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr, + return __xchg_bad_pointer(); + } + +-#define xchg(ptr, with) ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), \ +- sizeof(*(ptr)))) ++#define xchg(ptr, with) ({ \ ++ (typeof(*(ptr)))__xchg((unsigned long)(with), \ ++ (ptr), \ ++ sizeof(*(ptr))); \ ++}) + + #endif /* CONFIG_ARC_PLAT_EZNPS */ + +diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c +index 8ceefbf72fb0..e5817b9b2c3f 100644 +--- a/arch/arc/mm/tlb.c ++++ b/arch/arc/mm/tlb.c +@@ -902,9 +902,11 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address, + struct pt_regs *regs) + { + struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu; +- unsigned int pd0[mmu->ways]; + unsigned long flags; +- int set; ++ int set, n_ways = mmu->ways; ++ ++ n_ways = min(n_ways, 4); ++ BUG_ON(mmu->ways > 4); + + local_irq_save(flags); + +@@ -912,9 +914,10 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address, + for (set = 0; set < mmu->sets; set++) { + + int is_valid, way; ++ unsigned int pd0[4]; + + /* read out all the ways of current set */ +- for (way = 0, is_valid = 0; way < mmu->ways; way++) { ++ for (way = 0, is_valid = 0; way < n_ways; way++) { + write_aux_reg(ARC_REG_TLBINDEX, + SET_WAY_TO_IDX(mmu, set, way)); + write_aux_reg(ARC_REG_TLBCOMMAND, TLBRead); +@@ -928,14 +931,14 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address, + continue; + + /* Scan the set for duplicate ways: needs a nested loop */ +- for (way = 0; way < mmu->ways - 1; way++) { ++ for (way = 0; way < n_ways - 1; way++) { + + int n; + + if (!pd0[way]) + continue; + +- for (n = way + 1; n < mmu->ways; n++) { ++ for (n = way + 1; n < n_ways; n++) { + if (pd0[way] != pd0[n]) + continue; + +-- +2.20.1 + diff --git a/queue-4.14/arc-plat-hsdk-add-missing-fifo-size-entry-in-gmac-no.patch b/queue-4.14/arc-plat-hsdk-add-missing-fifo-size-entry-in-gmac-no.patch new file mode 100644 index 0000000000..d6c353f3d7 --- /dev/null +++ b/queue-4.14/arc-plat-hsdk-add-missing-fifo-size-entry-in-gmac-no.patch @@ -0,0 +1,39 @@ +From d087be9e0f7637a9b4184665e4024d5805e19f35 Mon Sep 17 00:00:00 2001 +From: Jose Abreu +Date: Mon, 20 May 2019 15:43:13 +0200 +Subject: ARC: [plat-hsdk]: Add missing FIFO size entry in GMAC node + +[ Upstream commit 4c70850aeb2e40016722cd1abd43c679666d3ca0 ] + +Add the binding for RX/TX fifo size of GMAC node. + +Cc: Joao Pinto +Cc: Rob Herring +Cc: Mark Rutland +Cc: Vineet Gupta +Tested-by: Eugeniy Paltsev +Acked-by: Alexey Brodkin +Signed-off-by: Jose Abreu +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/boot/dts/hsdk.dts | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts +index c033ae45fe42..57d81c6aa379 100644 +--- a/arch/arc/boot/dts/hsdk.dts ++++ b/arch/arc/boot/dts/hsdk.dts +@@ -170,6 +170,9 @@ + resets = <&cgu_rst HSDK_ETH_RESET>; + reset-names = "stmmaceth"; + ++ tx-fifo-depth = <4096>; ++ rx-fifo-depth = <4096>; ++ + mdio { + #address-cells = <1>; + #size-cells = <0>; +-- +2.20.1 + diff --git a/queue-4.14/arc-plat-hsdk-add-missing-multicast-filter-bins-numb.patch b/queue-4.14/arc-plat-hsdk-add-missing-multicast-filter-bins-numb.patch new file mode 100644 index 0000000000..b5a886c188 --- /dev/null +++ b/queue-4.14/arc-plat-hsdk-add-missing-multicast-filter-bins-numb.patch @@ -0,0 +1,39 @@ +From 7130b88e10680cc9df78c6fcb16b4c8cfc0f25d7 Mon Sep 17 00:00:00 2001 +From: Jose Abreu +Date: Mon, 20 May 2019 15:43:12 +0200 +Subject: ARC: [plat-hsdk]: Add missing multicast filter bins number to GMAC + node + +[ Upstream commit ecc906a11c2a0940e1a380debd8bd5bc09faf454 ] + +GMAC controller on HSDK boards supports 256 Hash Table size so we need to +add the multicast filter bins property. This allows for the Hash filter +to work properly using stmmac driver. + +Cc: Joao Pinto +Cc: Rob Herring +Cc: Mark Rutland +Cc: Eugeniy Paltsev +Acked-by: Alexey Brodkin +Signed-off-by: Jose Abreu +Signed-off-by: Vineet Gupta +Signed-off-by: Sasha Levin +--- + arch/arc/boot/dts/hsdk.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts +index 8f627c200d60..c033ae45fe42 100644 +--- a/arch/arc/boot/dts/hsdk.dts ++++ b/arch/arc/boot/dts/hsdk.dts +@@ -163,6 +163,7 @@ + interrupt-names = "macirq"; + phy-mode = "rgmii"; + snps,pbl = <32>; ++ snps,multicast-filter-bins = <256>; + clocks = <&gmacclk>; + clock-names = "stmmaceth"; + phy-handle = <&phy0>; +-- +2.20.1 + diff --git a/queue-4.14/drm-arm-hdlcd-actually-validate-crtc-modes.patch b/queue-4.14/drm-arm-hdlcd-actually-validate-crtc-modes.patch new file mode 100644 index 0000000000..02b59e3b3b --- /dev/null +++ b/queue-4.14/drm-arm-hdlcd-actually-validate-crtc-modes.patch @@ -0,0 +1,63 @@ +From 97cb5df6d43cedb16b9fdd12464d87f1fe58b0d4 Mon Sep 17 00:00:00 2001 +From: Robin Murphy +Date: Fri, 17 May 2019 17:37:21 +0100 +Subject: drm/arm/hdlcd: Actually validate CRTC modes + +[ Upstream commit b96151edced4edb6a18aa89a5fa02c7066efff45 ] + +Rather than allowing any old mode through, then subsequently refusing +unmatchable clock rates in atomic_check when it's too late to back out +and pick a different mode, let's do that validation up-front where it +will cause unsupported modes to be correctly pruned in the first place. + +This also eliminates an issue whereby a perceived clock rate of 0 would +cause atomic disable to fail and prevent the module from being unloaded. + +Signed-off-by: Robin Murphy +Signed-off-by: Liviu Dudau +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/arm/hdlcd_crtc.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c +index 72b22b805412..4a108660cc8f 100644 +--- a/drivers/gpu/drm/arm/hdlcd_crtc.c ++++ b/drivers/gpu/drm/arm/hdlcd_crtc.c +@@ -186,20 +186,19 @@ static void hdlcd_crtc_atomic_disable(struct drm_crtc *crtc, + clk_disable_unprepare(hdlcd->clk); + } + +-static int hdlcd_crtc_atomic_check(struct drm_crtc *crtc, +- struct drm_crtc_state *state) ++static enum drm_mode_status hdlcd_crtc_mode_valid(struct drm_crtc *crtc, ++ const struct drm_display_mode *mode) + { + struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc); +- struct drm_display_mode *mode = &state->adjusted_mode; + long rate, clk_rate = mode->clock * 1000; + + rate = clk_round_rate(hdlcd->clk, clk_rate); + if (rate != clk_rate) { + /* clock required by mode not supported by hardware */ +- return -EINVAL; ++ return MODE_NOCLOCK; + } + +- return 0; ++ return MODE_OK; + } + + static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc, +@@ -220,7 +219,7 @@ static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc, + } + + static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { +- .atomic_check = hdlcd_crtc_atomic_check, ++ .mode_valid = hdlcd_crtc_mode_valid, + .atomic_begin = hdlcd_crtc_atomic_begin, + .atomic_enable = hdlcd_crtc_atomic_enable, + .atomic_disable = hdlcd_crtc_atomic_disable, +-- +2.20.1 + diff --git a/queue-4.14/drm-arm-hdlcd-allow-a-bit-of-clock-tolerance.patch b/queue-4.14/drm-arm-hdlcd-allow-a-bit-of-clock-tolerance.patch new file mode 100644 index 0000000000..d598927541 --- /dev/null +++ b/queue-4.14/drm-arm-hdlcd-allow-a-bit-of-clock-tolerance.patch @@ -0,0 +1,39 @@ +From c2f907a5c0c54919d984eca5c19784a44a623571 Mon Sep 17 00:00:00 2001 +From: Robin Murphy +Date: Fri, 17 May 2019 17:37:22 +0100 +Subject: drm/arm/hdlcd: Allow a bit of clock tolerance + +[ Upstream commit 1c810739097fdeb31b393b67a0a1e3d7ffdd9f63 ] + +On the Arm Juno platform, the HDLCD pixel clock is constrained to 250KHz +resolution in order to avoid the tiny System Control Processor spending +aeons trying to calculate exact PLL coefficients. This means that modes +like my oddball 1600x1200 with 130.89MHz clock get rejected since the +rate cannot be matched exactly. In practice, though, this mode works +quite happily with the clock at 131MHz, so let's relax the check to +allow a little bit of slop. + +Signed-off-by: Robin Murphy +Signed-off-by: Liviu Dudau +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/arm/hdlcd_crtc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c +index 4a108660cc8f..6f03700a94be 100644 +--- a/drivers/gpu/drm/arm/hdlcd_crtc.c ++++ b/drivers/gpu/drm/arm/hdlcd_crtc.c +@@ -193,7 +193,8 @@ static enum drm_mode_status hdlcd_crtc_mode_valid(struct drm_crtc *crtc, + long rate, clk_rate = mode->clock * 1000; + + rate = clk_round_rate(hdlcd->clk, clk_rate); +- if (rate != clk_rate) { ++ /* 0.1% seems a close enough tolerance for the TDA19988 on Juno */ ++ if (abs(rate - clk_rate) * 1000 > clk_rate) { + /* clock required by mode not supported by hardware */ + return MODE_NOCLOCK; + } +-- +2.20.1 + diff --git a/queue-4.14/hwmon-core-add-thermal-sensors-only-if-dev-of_node-i.patch b/queue-4.14/hwmon-core-add-thermal-sensors-only-if-dev-of_node-i.patch new file mode 100644 index 0000000000..a9c7d7633e --- /dev/null +++ b/queue-4.14/hwmon-core-add-thermal-sensors-only-if-dev-of_node-i.patch @@ -0,0 +1,62 @@ +From 576aaa4f0ce243185c856a2ca7b7d25632dbc1fb Mon Sep 17 00:00:00 2001 +From: Eduardo Valentin +Date: Wed, 29 May 2019 19:56:04 -0700 +Subject: hwmon: (core) add thermal sensors only if dev->of_node is present + +[ Upstream commit c41dd48e21fae3e55b3670ccf2eb562fc1f6a67d ] + +Drivers may register to hwmon and request for also registering +with the thermal subsystem (HWMON_C_REGISTER_TZ). However, +some of these driver, e.g. marvell phy, may be probed from +Device Tree or being dynamically allocated, and in the later +case, it will not have a dev->of_node entry. + +Registering with hwmon without the dev->of_node may result in +different outcomes depending on the device tree, which may +be a bit misleading. If the device tree blob has no 'thermal-zones' +node, the *hwmon_device_register*() family functions are going +to gracefully succeed, because of-thermal, +*thermal_zone_of_sensor_register() return -ENODEV in this case, +and the hwmon error path handles this error code as success to +cover for the case where CONFIG_THERMAL_OF is not set. +However, if the device tree blob has the 'thermal-zones' +entry, the *hwmon_device_register*() will always fail on callers +with no dev->of_node, propagating -EINVAL. + +If dev->of_node is not present, calling of-thermal does not +make sense. For this reason, this patch checks first if the +device has a of_node before going over the process of registering +with the thermal subsystem of-thermal interface. And in this case, +when a caller of *hwmon_device_register*() with HWMON_C_REGISTER_TZ +and no dev->of_node will still register with hwmon, but not with +the thermal subsystem. If all the hwmon part bits are in place, +the registration will succeed. + +Fixes: d560168b5d0f ("hwmon: (core) New hwmon registration API") +Cc: Jean Delvare +Cc: Guenter Roeck +Cc: linux-hwmon@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Eduardo Valentin +Signed-off-by: Guenter Roeck +Signed-off-by: Sasha Levin +--- + drivers/hwmon/hwmon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c +index c9790e2c3440..7b53065e9882 100644 +--- a/drivers/hwmon/hwmon.c ++++ b/drivers/hwmon/hwmon.c +@@ -608,7 +608,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, + if (err) + goto free_hwmon; + +- if (dev && chip && chip->ops->read && ++ if (dev && dev->of_node && chip && chip->ops->read && + chip->info[0]->type == hwmon_chip && + (chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) { + const struct hwmon_channel_info **info = chip->info; +-- +2.20.1 + diff --git a/queue-4.14/hwmon-pmbus-core-treat-parameters-as-paged-if-on-mul.patch b/queue-4.14/hwmon-pmbus-core-treat-parameters-as-paged-if-on-mul.patch new file mode 100644 index 0000000000..0e287f87fa --- /dev/null +++ b/queue-4.14/hwmon-pmbus-core-treat-parameters-as-paged-if-on-mul.patch @@ -0,0 +1,101 @@ +From 08e7058b84284da65fe423211f80d920b3164d13 Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Wed, 5 Jun 2019 13:49:00 -0600 +Subject: hwmon: (pmbus/core) Treat parameters as paged if on multiple pages + +[ Upstream commit 4a60570dce658e3f8885bbcf852430b99f65aca5 ] + +Some chips have attributes which exist on more than one page but the +attribute is not presently marked as paged. This causes the attributes +to be generated with the same label, which makes it impossible for +userspace to tell them apart. + +Marking all such attributes as paged would result in the page suffix +being added regardless of whether they were present on more than one +page or not, which might break existing setups. Therefore, we add a +second check which treats the attribute as paged, even if not marked as +such, if it is present on multiple pages. + +Fixes: b4ce237b7f7d ("hwmon: (pmbus) Introduce infrastructure to detect sensors and limit registers") +Signed-off-by: Robert Hancock +Signed-off-by: Guenter Roeck +Signed-off-by: Sasha Levin +--- + drivers/hwmon/pmbus/pmbus_core.c | 34 ++++++++++++++++++++++++++++---- + 1 file changed, 30 insertions(+), 4 deletions(-) + +diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c +index 924f3ca41c65..cb9064ac4977 100644 +--- a/drivers/hwmon/pmbus/pmbus_core.c ++++ b/drivers/hwmon/pmbus/pmbus_core.c +@@ -1055,7 +1055,8 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client, + const struct pmbus_driver_info *info, + const char *name, + int index, int page, +- const struct pmbus_sensor_attr *attr) ++ const struct pmbus_sensor_attr *attr, ++ bool paged) + { + struct pmbus_sensor *base; + bool upper = !!(attr->gbit & 0xff00); /* need to check STATUS_WORD */ +@@ -1063,7 +1064,7 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client, + + if (attr->label) { + ret = pmbus_add_label(data, name, index, attr->label, +- attr->paged ? page + 1 : 0); ++ paged ? page + 1 : 0); + if (ret) + return ret; + } +@@ -1096,6 +1097,30 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client, + return 0; + } + ++static bool pmbus_sensor_is_paged(const struct pmbus_driver_info *info, ++ const struct pmbus_sensor_attr *attr) ++{ ++ int p; ++ ++ if (attr->paged) ++ return true; ++ ++ /* ++ * Some attributes may be present on more than one page despite ++ * not being marked with the paged attribute. If that is the case, ++ * then treat the sensor as being paged and add the page suffix to the ++ * attribute name. ++ * We don't just add the paged attribute to all such attributes, in ++ * order to maintain the un-suffixed labels in the case where the ++ * attribute is only on page 0. ++ */ ++ for (p = 1; p < info->pages; p++) { ++ if (info->func[p] & attr->func) ++ return true; ++ } ++ return false; ++} ++ + static int pmbus_add_sensor_attrs(struct i2c_client *client, + struct pmbus_data *data, + const char *name, +@@ -1109,14 +1134,15 @@ static int pmbus_add_sensor_attrs(struct i2c_client *client, + index = 1; + for (i = 0; i < nattrs; i++) { + int page, pages; ++ bool paged = pmbus_sensor_is_paged(info, attrs); + +- pages = attrs->paged ? info->pages : 1; ++ pages = paged ? info->pages : 1; + for (page = 0; page < pages; page++) { + if (!(info->func[page] & attrs->func)) + continue; + ret = pmbus_add_sensor_attrs_one(client, data, info, + name, index, page, +- attrs); ++ attrs, paged); + if (ret) + return ret; + index++; +-- +2.20.1 + diff --git a/queue-4.14/ib-hfi1-insure-freeze_work-work_struct-is-canceled-o.patch b/queue-4.14/ib-hfi1-insure-freeze_work-work_struct-is-canceled-o.patch new file mode 100644 index 0000000000..7720b26dd7 --- /dev/null +++ b/queue-4.14/ib-hfi1-insure-freeze_work-work_struct-is-canceled-o.patch @@ -0,0 +1,38 @@ +From 328770bb4f57d6b23c976f5c33d8ba8a94f5d14b Mon Sep 17 00:00:00 2001 +From: Mike Marciniszyn +Date: Fri, 24 May 2019 11:44:45 -0400 +Subject: IB/hfi1: Insure freeze_work work_struct is canceled on shutdown + +[ Upstream commit 6d517353c70bb0818b691ca003afdcb5ee5ea44e ] + +By code inspection, the freeze_work is never canceled. + +Fix by adding a cancel_work_sync in the shutdown path to insure it is no +longer running. + +Fixes: 7724105686e7 ("IB/hfi1: add driver files") +Reviewed-by: Michael J. Ruhl +Reviewed-by: Dennis Dalessandro +Signed-off-by: Mike Marciniszyn +Signed-off-by: Dennis Dalessandro +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/hfi1/chip.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c +index db33ad985a12..69a79fdfa23e 100644 +--- a/drivers/infiniband/hw/hfi1/chip.c ++++ b/drivers/infiniband/hw/hfi1/chip.c +@@ -9823,6 +9823,7 @@ void hfi1_quiet_serdes(struct hfi1_pportdata *ppd) + + /* disable the port */ + clear_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK); ++ cancel_work_sync(&ppd->freeze_work); + } + + static inline int init_cpu_counters(struct hfi1_devdata *dd) +-- +2.20.1 + diff --git a/queue-4.14/ib-hfi1-validate-page-aligned-for-a-given-virtual-ad.patch b/queue-4.14/ib-hfi1-validate-page-aligned-for-a-given-virtual-ad.patch new file mode 100644 index 0000000000..615bf9a61a --- /dev/null +++ b/queue-4.14/ib-hfi1-validate-page-aligned-for-a-given-virtual-ad.patch @@ -0,0 +1,41 @@ +From 5997c2eb83cc9da7cd0e85dd5173d0477d01ac67 Mon Sep 17 00:00:00 2001 +From: Kamenee Arumugam +Date: Fri, 24 May 2019 11:45:04 -0400 +Subject: IB/hfi1: Validate page aligned for a given virtual address + +[ Upstream commit 97736f36dbebf2cda2799db3b54717ba5b388255 ] + +User applications can register memory regions for TID buffers that are not +aligned on page boundaries. Hfi1 is expected to pin those pages in memory +and cache the pages with mmu_rb. The rb tree will fail to insert pages +that are not aligned correctly. + +Validate whether a given virtual address is page aligned before pinning. + +Fixes: 7e7a436ecb6e ("staging/hfi1: Add TID entry program function body") +Reviewed-by: Michael J. Ruhl +Signed-off-by: Kamenee Arumugam +Signed-off-by: Dennis Dalessandro +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/hfi1/user_exp_rcv.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c +index 6f6c14df383e..b38e3808836c 100644 +--- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c ++++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c +@@ -324,6 +324,9 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd, + u32 *tidlist = NULL; + struct tid_user_buf *tidbuf; + ++ if (!PAGE_ALIGNED(tinfo->vaddr)) ++ return -EINVAL; ++ + tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL); + if (!tidbuf) + return -ENOMEM; +-- +2.20.1 + diff --git a/queue-4.14/ib-qib-hfi1-rdmavt-correct-ibv_devinfo-max_mr-value.patch b/queue-4.14/ib-qib-hfi1-rdmavt-correct-ibv_devinfo-max_mr-value.patch new file mode 100644 index 0000000000..4c37ac6b14 --- /dev/null +++ b/queue-4.14/ib-qib-hfi1-rdmavt-correct-ibv_devinfo-max_mr-value.patch @@ -0,0 +1,66 @@ +From 12f30d7d1718260407976ff21d3a07dc1d3e701f Mon Sep 17 00:00:00 2001 +From: Mike Marciniszyn +Date: Fri, 24 May 2019 11:44:51 -0400 +Subject: IB/{qib, hfi1, rdmavt}: Correct ibv_devinfo max_mr value + +[ Upstream commit 35164f5259a47ea756fa1deb3e463ac2a4f10dc9 ] + +The command 'ibv_devinfo -v' reports 0 for max_mr. + +Fix by assigning the query values after the mr lkey_table has been built +rather than early on in the driver. + +Fixes: 7b1e2099adc8 ("IB/rdmavt: Move memory registration into rdmavt") +Reviewed-by: Josh Collier +Signed-off-by: Mike Marciniszyn +Signed-off-by: Dennis Dalessandro +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/hfi1/verbs.c | 2 -- + drivers/infiniband/hw/qib/qib_verbs.c | 2 -- + drivers/infiniband/sw/rdmavt/mr.c | 2 ++ + 3 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c +index 2e8854ba18cf..f4372afa0e81 100644 +--- a/drivers/infiniband/hw/hfi1/verbs.c ++++ b/drivers/infiniband/hw/hfi1/verbs.c +@@ -1400,8 +1400,6 @@ static void hfi1_fill_device_attr(struct hfi1_devdata *dd) + rdi->dparms.props.max_cq = hfi1_max_cqs; + rdi->dparms.props.max_ah = hfi1_max_ahs; + rdi->dparms.props.max_cqe = hfi1_max_cqes; +- rdi->dparms.props.max_mr = rdi->lkey_table.max; +- rdi->dparms.props.max_fmr = rdi->lkey_table.max; + rdi->dparms.props.max_map_per_fmr = 32767; + rdi->dparms.props.max_pd = hfi1_max_pds; + rdi->dparms.props.max_qp_rd_atom = HFI1_MAX_RDMA_ATOMIC; +diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c +index 9d92aeb8d9a1..350bc29a066f 100644 +--- a/drivers/infiniband/hw/qib/qib_verbs.c ++++ b/drivers/infiniband/hw/qib/qib_verbs.c +@@ -1495,8 +1495,6 @@ static void qib_fill_device_attr(struct qib_devdata *dd) + rdi->dparms.props.max_cq = ib_qib_max_cqs; + rdi->dparms.props.max_cqe = ib_qib_max_cqes; + rdi->dparms.props.max_ah = ib_qib_max_ahs; +- rdi->dparms.props.max_mr = rdi->lkey_table.max; +- rdi->dparms.props.max_fmr = rdi->lkey_table.max; + rdi->dparms.props.max_map_per_fmr = 32767; + rdi->dparms.props.max_qp_rd_atom = QIB_MAX_RDMA_ATOMIC; + rdi->dparms.props.max_qp_init_rd_atom = 255; +diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c +index e7013d2d4f0e..d5b51f4cb49a 100644 +--- a/drivers/infiniband/sw/rdmavt/mr.c ++++ b/drivers/infiniband/sw/rdmavt/mr.c +@@ -96,6 +96,8 @@ int rvt_driver_mr_init(struct rvt_dev_info *rdi) + for (i = 0; i < rdi->lkey_table.max; i++) + RCU_INIT_POINTER(rdi->lkey_table.table[i], NULL); + ++ rdi->dparms.props.max_mr = rdi->lkey_table.max; ++ rdi->dparms.props.max_fmr = rdi->lkey_table.max; + return 0; + } + +-- +2.20.1 + diff --git a/queue-4.14/ib-rdmavt-fix-alloc_qpn-warn_on.patch b/queue-4.14/ib-rdmavt-fix-alloc_qpn-warn_on.patch new file mode 100644 index 0000000000..dcbc32e06a --- /dev/null +++ b/queue-4.14/ib-rdmavt-fix-alloc_qpn-warn_on.patch @@ -0,0 +1,57 @@ +From 66d7aab68c302abb0e8511eaabd722964a681fb7 Mon Sep 17 00:00:00 2001 +From: Mike Marciniszyn +Date: Fri, 24 May 2019 11:44:38 -0400 +Subject: IB/rdmavt: Fix alloc_qpn() WARN_ON() + +[ Upstream commit 2abae62a26a265129b364d8c1ef3be55e2c01309 ] + +The qpn allocation logic has a WARN_ON() that intends to detect the use of +an index that will introduce bits in the lower order bits of the QOS bits +in the QPN. + +Unfortunately, it has the following bugs: +- it misfires when wrapping QPN allocation for non-QOS +- it doesn't correctly detect low order QOS bits (despite the comment) + +The WARN_ON() should not be applied to non-QOS (qos_shift == 1). + +Additionally, it SHOULD test the qpn bits per the table below: + +2 data VLs: [qp7, qp6, qp5, qp4, qp3, qp2, qp1] ^ + [ 0, 0, 0, 0, 0, 0, sc0], qp bit 1 always 0* +3-4 data VLs: [qp7, qp6, qp5, qp4, qp3, qp2, qp1] ^ + [ 0, 0, 0, 0, 0, sc1, sc0], qp bits [21] always 0 +5-8 data VLs: [qp7, qp6, qp5, qp4, qp3, qp2, qp1] ^ + [ 0, 0, 0, 0, sc2, sc1, sc0] qp bits [321] always 0 + +Fix by qualifying the warning for qos_shift > 1 and producing the correct +mask to insure the above bits are zero without generating a superfluous +warning. + +Fixes: 501edc42446e ("IB/rdmavt: Correct warning during QPN allocation") +Reviewed-by: Kaike Wan +Signed-off-by: Mike Marciniszyn +Signed-off-by: Dennis Dalessandro +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/sw/rdmavt/qp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c +index 22df09ae809e..b0309876f4bb 100644 +--- a/drivers/infiniband/sw/rdmavt/qp.c ++++ b/drivers/infiniband/sw/rdmavt/qp.c +@@ -412,7 +412,8 @@ static int alloc_qpn(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt, + offset = qpt->incr | ((offset & 1) ^ 1); + } + /* there can be no set bits in low-order QoS bits */ +- WARN_ON(offset & (BIT(rdi->dparms.qos_shift) - 1)); ++ WARN_ON(rdi->dparms.qos_shift > 1 && ++ offset & ((BIT(rdi->dparms.qos_shift - 1) - 1) << 1)); + qpn = mk_qpn(qpt, map, offset); + } + +-- +2.20.1 + diff --git a/queue-4.14/mdesc-fix-a-missing-check-bug-in-get_vdev_port_node_.patch b/queue-4.14/mdesc-fix-a-missing-check-bug-in-get_vdev_port_node_.patch new file mode 100644 index 0000000000..cf5c7cb20a --- /dev/null +++ b/queue-4.14/mdesc-fix-a-missing-check-bug-in-get_vdev_port_node_.patch @@ -0,0 +1,34 @@ +From 58fc8b8b041148803f4dfc0d4db288d2d2e8daf5 Mon Sep 17 00:00:00 2001 +From: Gen Zhang +Date: Fri, 31 May 2019 09:24:18 +0800 +Subject: mdesc: fix a missing-check bug in get_vdev_port_node_info() + +[ Upstream commit 80caf43549e7e41a695c6d1e11066286538b336f ] + +In get_vdev_port_node_info(), 'node_info->vdev_port.name' is allcoated +by kstrdup_const(), and it returns NULL when fails. So +'node_info->vdev_port.name' should be checked. + +Signed-off-by: Gen Zhang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + arch/sparc/kernel/mdesc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c +index 1ef6156b1530..8f24f3d60b8c 100644 +--- a/arch/sparc/kernel/mdesc.c ++++ b/arch/sparc/kernel/mdesc.c +@@ -355,6 +355,8 @@ static int get_vdev_port_node_info(struct mdesc_handle *md, u64 node, + + node_info->vdev_port.id = *idp; + node_info->vdev_port.name = kstrdup_const(name, GFP_KERNEL); ++ if (!node_info->vdev_port.name) ++ return -1; + node_info->vdev_port.parent_cfg_hdl = *parent_cfg_hdlp; + + return 0; +-- +2.20.1 + diff --git a/queue-4.14/mips-uprobes-remove-set-but-not-used-variable-epc.patch b/queue-4.14/mips-uprobes-remove-set-but-not-used-variable-epc.patch new file mode 100644 index 0000000000..59c58577bc --- /dev/null +++ b/queue-4.14/mips-uprobes-remove-set-but-not-used-variable-epc.patch @@ -0,0 +1,43 @@ +From 8318d0d972bf8f4030100fcef3a6b02e960a590d Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Sat, 25 May 2019 20:20:24 +0800 +Subject: MIPS: uprobes: remove set but not used variable 'epc' + +[ Upstream commit f532beeeff0c0a3586cc15538bc52d249eb19e7c ] + +Fixes gcc '-Wunused-but-set-variable' warning: + +arch/mips/kernel/uprobes.c: In function 'arch_uprobe_pre_xol': +arch/mips/kernel/uprobes.c:115:17: warning: variable 'epc' set but not used [-Wunused-but-set-variable] + +It's never used since introduction in +commit 40e084a506eb ("MIPS: Add uprobes support.") + +Signed-off-by: YueHaibing +Signed-off-by: Paul Burton +Cc: +Cc: +Cc: +Cc: +Signed-off-by: Sasha Levin +--- + arch/mips/kernel/uprobes.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c +index f7a0645ccb82..6305e91ffc44 100644 +--- a/arch/mips/kernel/uprobes.c ++++ b/arch/mips/kernel/uprobes.c +@@ -112,9 +112,6 @@ int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs) + */ + aup->resume_epc = regs->cp0_epc + 4; + if (insn_has_delay_slot((union mips_instruction) aup->insn[0])) { +- unsigned long epc; +- +- epc = regs->cp0_epc; + __compute_return_epc_for_insn(regs, + (union mips_instruction) aup->insn[0]); + aup->resume_epc = regs->cp0_epc; +-- +2.20.1 + diff --git a/queue-4.14/net-dsa-mv88e6xxx-avoid-error-message-on-remove-from.patch b/queue-4.14/net-dsa-mv88e6xxx-avoid-error-message-on-remove-from.patch new file mode 100644 index 0000000000..d8d5968656 --- /dev/null +++ b/queue-4.14/net-dsa-mv88e6xxx-avoid-error-message-on-remove-from.patch @@ -0,0 +1,48 @@ +From f7d48c53691f397e19d9d844e92697464bc4a792 Mon Sep 17 00:00:00 2001 +From: Nikita Yushchenko +Date: Fri, 31 May 2019 10:35:14 +0300 +Subject: net: dsa: mv88e6xxx: avoid error message on remove from VLAN 0 + +[ Upstream commit 62394708f3e01c9f2be6be74eb6305bae1ed924f ] + +When non-bridged, non-vlan'ed mv88e6xxx port is moving down, error +message is logged: + +failed to kill vid 0081/0 for device eth_cu_1000_4 + +This is caused by call from __vlan_vid_del() with vin set to zero, over +call chain this results into _mv88e6xxx_port_vlan_del() called with +vid=0, and mv88e6xxx_vtu_get() called from there returns -EINVAL. + +On symmetric path moving port up, call goes through +mv88e6xxx_port_vlan_prepare() that calls mv88e6xxx_port_check_hw_vlan() +that returns -EOPNOTSUPP for zero vid. + +This patch changes mv88e6xxx_vtu_get() to also return -EOPNOTSUPP for +zero vid, then this error code is explicitly cleared in +dsa_slave_vlan_rx_kill_vid() and error message is no longer logged. + +Signed-off-by: Nikita Yushchenko +Reviewed-by: Vivien Didelot +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/dsa/mv88e6xxx/chip.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c +index 172b13012e10..086603de1859 100644 +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -1075,7 +1075,7 @@ static int mv88e6xxx_vtu_get(struct mv88e6xxx_chip *chip, u16 vid, + int err; + + if (!vid) +- return -EINVAL; ++ return -EOPNOTSUPP; + + entry->vid = vid - 1; + entry->valid = false; +-- +2.20.1 + diff --git a/queue-4.14/net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch b/queue-4.14/net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch new file mode 100644 index 0000000000..763a4b2091 --- /dev/null +++ b/queue-4.14/net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch @@ -0,0 +1,70 @@ +From 55d9957c1a2514197e07f6d090d43cc673c245be Mon Sep 17 00:00:00 2001 +From: Sean Wang +Date: Sat, 1 Jun 2019 08:16:26 +0800 +Subject: net: ethernet: mediatek: Use hw_feature to judge if HWLRO is + supported + +[ Upstream commit 9e4f56f1a7f3287718d0083b5cb85298dc05a5fd ] + +Should hw_feature as hardware capability flags to check if hardware LRO +got support. + +Signed-off-by: Mark Lee +Signed-off-by: Sean Wang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +index 3fd71cf5cd60..5208bf61df10 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -2304,13 +2304,13 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, + + switch (cmd->cmd) { + case ETHTOOL_GRXRINGS: +- if (dev->features & NETIF_F_LRO) { ++ if (dev->hw_features & NETIF_F_LRO) { + cmd->data = MTK_MAX_RX_RING_NUM; + ret = 0; + } + break; + case ETHTOOL_GRXCLSRLCNT: +- if (dev->features & NETIF_F_LRO) { ++ if (dev->hw_features & NETIF_F_LRO) { + struct mtk_mac *mac = netdev_priv(dev); + + cmd->rule_cnt = mac->hwlro_ip_cnt; +@@ -2318,11 +2318,11 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, + } + break; + case ETHTOOL_GRXCLSRULE: +- if (dev->features & NETIF_F_LRO) ++ if (dev->hw_features & NETIF_F_LRO) + ret = mtk_hwlro_get_fdir_entry(dev, cmd); + break; + case ETHTOOL_GRXCLSRLALL: +- if (dev->features & NETIF_F_LRO) ++ if (dev->hw_features & NETIF_F_LRO) + ret = mtk_hwlro_get_fdir_all(dev, cmd, + rule_locs); + break; +@@ -2339,11 +2339,11 @@ static int mtk_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd) + + switch (cmd->cmd) { + case ETHTOOL_SRXCLSRLINS: +- if (dev->features & NETIF_F_LRO) ++ if (dev->hw_features & NETIF_F_LRO) + ret = mtk_hwlro_add_ipaddr(dev, cmd); + break; + case ETHTOOL_SRXCLSRLDEL: +- if (dev->features & NETIF_F_LRO) ++ if (dev->hw_features & NETIF_F_LRO) + ret = mtk_hwlro_del_ipaddr(dev, cmd); + break; + default: +-- +2.20.1 + diff --git a/queue-4.14/net-ethernet-mediatek-use-net_ip_align-to-judge-if-h.patch b/queue-4.14/net-ethernet-mediatek-use-net_ip_align-to-judge-if-h.patch new file mode 100644 index 0000000000..639e3c50fd --- /dev/null +++ b/queue-4.14/net-ethernet-mediatek-use-net_ip_align-to-judge-if-h.patch @@ -0,0 +1,43 @@ +From eb0a0d3f1d330c07a305e5f69b9aa63efbe493cf Mon Sep 17 00:00:00 2001 +From: Sean Wang +Date: Sat, 1 Jun 2019 08:16:27 +0800 +Subject: net: ethernet: mediatek: Use NET_IP_ALIGN to judge if HW + RX_2BYTE_OFFSET is enabled + +[ Upstream commit 880c2d4b2fdfd580ebcd6bb7240a8027a1d34751 ] + +Should only enable HW RX_2BYTE_OFFSET function in the case NET_IP_ALIGN +equals to 2. + +Signed-off-by: Mark Lee +Signed-off-by: Sean Wang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +index 5208bf61df10..9ba699cbdbc5 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1788,6 +1788,7 @@ static void mtk_poll_controller(struct net_device *dev) + + static int mtk_start_dma(struct mtk_eth *eth) + { ++ u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0; + int err; + + err = mtk_dma_init(eth); +@@ -1804,7 +1805,7 @@ static int mtk_start_dma(struct mtk_eth *eth) + MTK_QDMA_GLO_CFG); + + mtk_w32(eth, +- MTK_RX_DMA_EN | MTK_RX_2B_OFFSET | ++ MTK_RX_DMA_EN | rx_2b_offset | + MTK_RX_BT_32DWORDS | MTK_MULTI_EN, + MTK_PDMA_GLO_CFG); + +-- +2.20.1 + diff --git a/queue-4.14/net-hns-fix-loopback-test-failed-at-copper-ports.patch b/queue-4.14/net-hns-fix-loopback-test-failed-at-copper-ports.patch new file mode 100644 index 0000000000..e1cf09f537 --- /dev/null +++ b/queue-4.14/net-hns-fix-loopback-test-failed-at-copper-ports.patch @@ -0,0 +1,45 @@ +From 34c06f5dd4ead36a3f2f396e8aa48e74d0b9f385 Mon Sep 17 00:00:00 2001 +From: Yonglong Liu +Date: Fri, 31 May 2019 16:59:50 +0800 +Subject: net: hns: Fix loopback test failed at copper ports + +[ Upstream commit 2e1f164861e500f4e068a9d909bbd3fcc7841483 ] + +When doing a loopback test at copper ports, the serdes loopback +and the phy loopback will fail, because of the adjust link had +not finished, and phy not ready. + +Adds sleep between adjust link and test process to fix it. + +Signed-off-by: Yonglong Liu +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +index 14df03f60e05..523d52fbaafe 100644 +--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c ++++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +@@ -338,6 +338,7 @@ static int __lb_setup(struct net_device *ndev, + static int __lb_up(struct net_device *ndev, + enum hnae_loop loop_mode) + { ++#define NIC_LB_TEST_WAIT_PHY_LINK_TIME 300 + struct hns_nic_priv *priv = netdev_priv(ndev); + struct hnae_handle *h = priv->ae_handle; + int speed, duplex; +@@ -364,6 +365,9 @@ static int __lb_up(struct net_device *ndev, + + h->dev->ops->adjust_link(h, speed, duplex); + ++ /* wait adjust link done and phy ready */ ++ msleep(NIC_LB_TEST_WAIT_PHY_LINK_TIME); ++ + return 0; + } + +-- +2.20.1 + diff --git a/queue-4.14/net-ipvlan-fix-ipvlan-device-tso-disabled-while-neti.patch b/queue-4.14/net-ipvlan-fix-ipvlan-device-tso-disabled-while-neti.patch new file mode 100644 index 0000000000..4fe2b233b1 --- /dev/null +++ b/queue-4.14/net-ipvlan-fix-ipvlan-device-tso-disabled-while-neti.patch @@ -0,0 +1,45 @@ +From 5500eac66092e009d9ec28d16798f61a275af488 Mon Sep 17 00:00:00 2001 +From: Miaohe Lin +Date: Tue, 4 Jun 2019 06:07:34 +0000 +Subject: net: ipvlan: Fix ipvlan device tso disabled while NETIF_F_IP_CSUM is + set + +[ Upstream commit ceae266bf0ae6564ac16d086bf749a096fa90ded ] + +There's some NICs, such as hinic, with NETIF_F_IP_CSUM and NETIF_F_TSO +on but NETIF_F_HW_CSUM off. And ipvlan device features will be +NETIF_F_TSO on with NETIF_F_IP_CSUM and NETIF_F_IP_CSUM both off as +IPVLAN_FEATURES only care about NETIF_F_HW_CSUM. So TSO will be +disabled in netdev_fix_features. +For example: +Features for enp129s0f0: +rx-checksumming: on +tx-checksumming: on + tx-checksum-ipv4: on + tx-checksum-ip-generic: off [fixed] + tx-checksum-ipv6: on + +Fixes: a188222b6ed2 ("net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK") +Signed-off-by: Miaohe Lin +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ipvlan/ipvlan_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c +index d629dddb0e89..09f6795cce53 100644 +--- a/drivers/net/ipvlan/ipvlan_main.c ++++ b/drivers/net/ipvlan/ipvlan_main.c +@@ -188,7 +188,7 @@ static void ipvlan_port_destroy(struct net_device *dev) + } + + #define IPVLAN_FEATURES \ +- (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ ++ (NETIF_F_SG | NETIF_F_CSUM_MASK | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ + NETIF_F_GSO | NETIF_F_TSO | NETIF_F_GSO_ROBUST | \ + NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \ + NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER) +-- +2.20.1 + diff --git a/queue-4.14/nvme-fix-u32-overflow-in-the-number-of-namespace-lis.patch b/queue-4.14/nvme-fix-u32-overflow-in-the-number-of-namespace-lis.patch new file mode 100644 index 0000000000..701e255e49 --- /dev/null +++ b/queue-4.14/nvme-fix-u32-overflow-in-the-number-of-namespace-lis.patch @@ -0,0 +1,37 @@ +From dbe3b5b9fd5aa0912e52250dc112dbf4fc813455 Mon Sep 17 00:00:00 2001 +From: Jaesoo Lee +Date: Mon, 3 Jun 2019 16:42:28 -0700 +Subject: nvme: Fix u32 overflow in the number of namespace list calculation + +[ Upstream commit c8e8c77b3bdbade6e26e8e76595f141ede12b692 ] + +The Number of Namespaces (nn) field in the identify controller data structure is +defined as u32 and the maximum allowed value in NVMe specification is +0xFFFFFFFEUL. This change fixes the possible overflow of the DIV_ROUND_UP() +operation used in nvme_scan_ns_list() by casting the nn to u64. + +Signed-off-by: Jaesoo Lee +Reviewed-by: Christoph Hellwig +Signed-off-by: Sagi Grimberg +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c +index d98ffb1ce629..768ac752a6e3 100644 +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -2477,7 +2477,8 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl, unsigned nn) + { + struct nvme_ns *ns; + __le32 *ns_list; +- unsigned i, j, nsid, prev = 0, num_lists = DIV_ROUND_UP(nn, 1024); ++ unsigned i, j, nsid, prev = 0; ++ unsigned num_lists = DIV_ROUND_UP_ULL((u64)nn, 1024); + int ret = 0; + + ns_list = kzalloc(0x1000, GFP_KERNEL); +-- +2.20.1 + diff --git a/queue-4.14/parisc-fix-compiler-warnings-in-float-emulation-code.patch b/queue-4.14/parisc-fix-compiler-warnings-in-float-emulation-code.patch new file mode 100644 index 0000000000..fb7fbf8b9c --- /dev/null +++ b/queue-4.14/parisc-fix-compiler-warnings-in-float-emulation-code.patch @@ -0,0 +1,53 @@ +From 22a484151c858f742853e0fcf8010dcee4f2db8a Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Fri, 24 May 2019 23:16:25 +0200 +Subject: parisc: Fix compiler warnings in float emulation code +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ Upstream commit 6b98d9134e14f5ef4bcf64b27eedf484ed19a1ec ] + +Avoid such compiler warnings: +arch/parisc/math-emu/cnv_float.h:71:27: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context] + ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB)) +arch/parisc/math-emu/fcnvxf.c:257:6: note: in expansion of macro ‘Dint_isinexact_to_sgl’ + if (Dint_isinexact_to_sgl(srcp1,srcp2)) { + +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + arch/parisc/math-emu/cnv_float.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/parisc/math-emu/cnv_float.h b/arch/parisc/math-emu/cnv_float.h +index 933423fa5144..b0db61188a61 100644 +--- a/arch/parisc/math-emu/cnv_float.h ++++ b/arch/parisc/math-emu/cnv_float.h +@@ -60,19 +60,19 @@ + ((exponent < (SGL_P - 1)) ? \ + (Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE) + +-#define Int_isinexact_to_sgl(int_value) (int_value << 33 - SGL_EXP_LENGTH) ++#define Int_isinexact_to_sgl(int_value) ((int_value << 33 - SGL_EXP_LENGTH) != 0) + + #define Sgl_roundnearest_from_int(int_value,sgl_value) \ + if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \ +- if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value)) \ ++ if (((int_value << 34 - SGL_EXP_LENGTH) != 0) || Slow(sgl_value)) \ + Sall(sgl_value)++ + + #define Dint_isinexact_to_sgl(dint_valueA,dint_valueB) \ +- ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB)) ++ (((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) != 0) || Dintp2(dint_valueB)) + + #define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value) \ + if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \ +- if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) || \ ++ if (((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) != 0) || \ + Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++ + + #define Dint_isinexact_to_dbl(dint_value) \ +-- +2.20.1 + diff --git a/queue-4.14/parport-fix-mem-leak-in-parport_register_dev_model.patch b/queue-4.14/parport-fix-mem-leak-in-parport_register_dev_model.patch new file mode 100644 index 0000000000..0516c7c06e --- /dev/null +++ b/queue-4.14/parport-fix-mem-leak-in-parport_register_dev_model.patch @@ -0,0 +1,67 @@ +From d9cb8877764b108a9974f6ab9b064e725a64515f Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Tue, 14 May 2019 23:24:37 +0800 +Subject: parport: Fix mem leak in parport_register_dev_model + +[ Upstream commit 1c7ebeabc9e5ee12e42075a597de40fdb9059530 ] + +BUG: memory leak +unreferenced object 0xffff8881df48cda0 (size 16): + comm "syz-executor.0", pid 5077, jiffies 4295994670 (age 22.280s) + hex dump (first 16 bytes): + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + backtrace: + [<00000000d2d0d5fe>] parport_register_dev_model+0x141/0x6e0 [parport] + [<00000000782f6dab>] 0xffffffffc15d1196 + [<00000000d2ca6ae4>] platform_drv_probe+0x7e/0x100 + [<00000000628c2a94>] really_probe+0x342/0x4d0 + [<000000006874f5da>] driver_probe_device+0x8c/0x170 + [<00000000424de37a>] __device_attach_driver+0xda/0x100 + [<000000002acab09a>] bus_for_each_drv+0xfe/0x170 + [<000000003d9e5f31>] __device_attach+0x190/0x230 + [<0000000035d32f80>] bus_probe_device+0x123/0x140 + [<00000000a05ba627>] device_add+0x7cc/0xce0 + [<000000003f7560bf>] platform_device_add+0x230/0x3c0 + [<000000002a0be07d>] 0xffffffffc15d0949 + [<000000007361d8d2>] port_check+0x3b/0x50 [parport] + [<000000004d67200f>] bus_for_each_dev+0x115/0x180 + [<000000003ccfd11c>] __parport_register_driver+0x1f0/0x210 [parport] + [<00000000987f06fc>] 0xffffffffc15d803e + +After commit 4e5a74f1db8d ("parport: Revert "parport: fix +memory leak""), free_pardevice do not free par_dev->state, +we should free it in error path of parport_register_dev_model +before return. + +Reported-by: Hulk Robot +Fixes: 4e5a74f1db8d ("parport: Revert "parport: fix memory leak"") +Signed-off-by: YueHaibing +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/parport/share.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/parport/share.c b/drivers/parport/share.c +index 5dc53d420ca8..7b4ee33c1935 100644 +--- a/drivers/parport/share.c ++++ b/drivers/parport/share.c +@@ -895,6 +895,7 @@ parport_register_dev_model(struct parport *port, const char *name, + par_dev->devmodel = true; + ret = device_register(&par_dev->dev); + if (ret) { ++ kfree(par_dev->state); + put_device(&par_dev->dev); + goto err_put_port; + } +@@ -912,6 +913,7 @@ parport_register_dev_model(struct parport *port, const char *name, + spin_unlock(&port->physport->pardevice_lock); + pr_debug("%s: cannot grant exclusive access for device %s\n", + port->name, name); ++ kfree(par_dev->state); + device_unregister(&par_dev->dev); + goto err_put_port; + } +-- +2.20.1 + diff --git a/queue-4.14/s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-ud.patch b/queue-4.14/s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-ud.patch new file mode 100644 index 0000000000..4b40b77faf --- /dev/null +++ b/queue-4.14/s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-ud.patch @@ -0,0 +1,51 @@ +From 90085cfcb6e9dfa9023e90d567488792e016b5e2 Mon Sep 17 00:00:00 2001 +From: Alexandra Winter +Date: Wed, 5 Jun 2019 13:48:50 +0200 +Subject: s390/qeth: fix VLAN attribute in bridge_hostnotify udev event + +[ Upstream commit 335726195e460cb6b3f795b695bfd31f0ea70ef0 ] + +Enabling sysfs attribute bridge_hostnotify triggers a series of udev events +for the MAC addresses of all currently connected peers. In case no VLAN is +set for a peer, the device reports the corresponding MAC addresses with +VLAN ID 4096. This currently results in attribute VLAN=4096 for all +non-VLAN interfaces in the initial series of events after host-notify is +enabled. + +Instead, no VLAN attribute should be reported in the udev event for +non-VLAN interfaces. + +Only the initial events face this issue. For dynamic changes that are +reported later, the device uses a validity flag. + +This also changes the code so that it now sets the VLAN attribute for +MAC addresses with VID 0. On Linux, no qeth interface will ever be +registered with VID 0: Linux kernel registers VID 0 on all network +interfaces initially, but qeth will drop .ndo_vlan_rx_add_vid for VID 0. +Peers with other OSs could register MACs with VID 0. + +Fixes: 9f48b9db9a22 ("qeth: bridgeport support - address notifications") +Signed-off-by: Alexandra Winter +Signed-off-by: Julian Wiedmann +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/s390/net/qeth_l2_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c +index 11ae67842edf..2845316db554 100644 +--- a/drivers/s390/net/qeth_l2_main.c ++++ b/drivers/s390/net/qeth_l2_main.c +@@ -1998,7 +1998,7 @@ static void qeth_bridgeport_an_set_cb(void *priv, + + l2entry = (struct qdio_brinfo_entry_l2 *)entry; + code = IPA_ADDR_CHANGE_CODE_MACADDR; +- if (l2entry->addr_lnid.lnid) ++ if (l2entry->addr_lnid.lnid < VLAN_N_VID) + code |= IPA_ADDR_CHANGE_CODE_VLANID; + qeth_bridge_emit_host_event(card, anev_reg_unreg, code, + (struct net_if_token *)&l2entry->nit, +-- +2.20.1 + diff --git a/queue-4.14/scripts-checkstack.pl-fix-arm64-wrong-or-unknown-arc.patch b/queue-4.14/scripts-checkstack.pl-fix-arm64-wrong-or-unknown-arc.patch new file mode 100644 index 0000000000..ed16fb4516 --- /dev/null +++ b/queue-4.14/scripts-checkstack.pl-fix-arm64-wrong-or-unknown-arc.patch @@ -0,0 +1,42 @@ +From 422bd979dec07d83bf073833e309af78936773dd Mon Sep 17 00:00:00 2001 +From: "George G. Davis" +Date: Mon, 3 Jun 2019 10:30:39 -0400 +Subject: scripts/checkstack.pl: Fix arm64 wrong or unknown architecture + +[ Upstream commit 4f45d62a52297b10ded963412a158685647ecdec ] + +The following error occurs for the `make ARCH=arm64 checkstack` case: + +aarch64-linux-gnu-objdump -d vmlinux $(find . -name '*.ko') | \ +perl ./scripts/checkstack.pl arm64 +wrong or unknown architecture "arm64" + +As suggested by Masahiro Yamada, fix the above error using regular +expressions in the same way it was fixed for the `ARCH=x86` case via +commit fda9f9903be6 ("scripts/checkstack.pl: automatically handle +32-bit and 64-bit mode for ARCH=x86"). + +Suggested-by: Masahiro Yamada +Signed-off-by: George G. Davis +Signed-off-by: Masahiro Yamada +Signed-off-by: Sasha Levin +--- + scripts/checkstack.pl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl +index 16dc157f9662..a3f895c216b6 100755 +--- a/scripts/checkstack.pl ++++ b/scripts/checkstack.pl +@@ -45,7 +45,7 @@ my (@stack, $re, $dre, $x, $xs, $funcre); + $x = "[0-9a-f]"; # hex character + $xs = "[0-9a-f ]"; # hex character or space + $funcre = qr/^$x* <(.*)>:$/; +- if ($arch eq 'aarch64') { ++ if ($arch =~ '^(aarch|arm)64$') { + #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp, #-80]! + $re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o; + } elsif ($arch eq 'arm') { +-- +2.20.1 + diff --git a/queue-4.14/scsi-smartpqi-unlock-on-error-in-pqi_submit_raid_req.patch b/queue-4.14/scsi-smartpqi-unlock-on-error-in-pqi_submit_raid_req.patch new file mode 100644 index 0000000000..8e8a657252 --- /dev/null +++ b/queue-4.14/scsi-smartpqi-unlock-on-error-in-pqi_submit_raid_req.patch @@ -0,0 +1,39 @@ +From 5852c0b3a6b1a4ec56432b0f7eac909d73c70a52 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 29 May 2019 14:07:39 +0300 +Subject: scsi: smartpqi: unlock on error in + pqi_submit_raid_request_synchronous() + +[ Upstream commit cc8f52609bb4177febade24d11713e20c0893b0a ] + +We need to drop the "ctrl_info->sync_request_sem" lock before returning. + +Fixes: 6c223761eb54 ("smartpqi: initial commit of Microsemi smartpqi driver") +Signed-off-by: Dan Carpenter +Acked-by: Don Brace +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/smartpqi/smartpqi_init.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c +index d34351c6b9af..4055753b495a 100644 +--- a/drivers/scsi/smartpqi/smartpqi_init.c ++++ b/drivers/scsi/smartpqi/smartpqi_init.c +@@ -3686,8 +3686,10 @@ static int pqi_submit_raid_request_synchronous(struct pqi_ctrl_info *ctrl_info, + return -ETIMEDOUT; + msecs_blocked = + jiffies_to_msecs(jiffies - start_jiffies); +- if (msecs_blocked >= timeout_msecs) +- return -ETIMEDOUT; ++ if (msecs_blocked >= timeout_msecs) { ++ rc = -ETIMEDOUT; ++ goto out; ++ } + timeout_msecs -= msecs_blocked; + } + } +-- +2.20.1 + diff --git a/queue-4.14/scsi-ufs-check-that-space-was-properly-alloced-in-co.patch b/queue-4.14/scsi-ufs-check-that-space-was-properly-alloced-in-co.patch new file mode 100644 index 0000000000..0a35aae069 --- /dev/null +++ b/queue-4.14/scsi-ufs-check-that-space-was-properly-alloced-in-co.patch @@ -0,0 +1,42 @@ +From 37eccfd7b292572f2571fb941e704cd1373ce9a6 Mon Sep 17 00:00:00 2001 +From: Avri Altman +Date: Tue, 21 May 2019 11:24:22 +0300 +Subject: scsi: ufs: Check that space was properly alloced in + copy_query_response + +[ Upstream commit 1c90836f70f9a8ef7b7ad9e1fdd8961903e6ced6 ] + +struct ufs_dev_cmd is the main container that supports device management +commands. In the case of a read descriptor request, we assume that the +proper space was allocated in dev_cmd to hold the returning descriptor. + +This is no longer true, as there are flows that doesn't use dev_cmd for +device management requests, and was wrong in the first place. + +Fixes: d44a5f98bb49 (ufs: query descriptor API) +Signed-off-by: Avri Altman +Reviewed-by: Alim Akhtar +Acked-by: Bean Huo +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/ufs/ufshcd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c +index d8f0a1ccd9b1..60c9184bad3b 100644 +--- a/drivers/scsi/ufs/ufshcd.c ++++ b/drivers/scsi/ufs/ufshcd.c +@@ -1788,7 +1788,8 @@ int ufshcd_copy_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) + memcpy(&query_res->upiu_res, &lrbp->ucd_rsp_ptr->qr, QUERY_OSF_SIZE); + + /* Get the descriptor */ +- if (lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) { ++ if (hba->dev_cmd.query.descriptor && ++ lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) { + u8 *descp = (u8 *)lrbp->ucd_rsp_ptr + + GENERAL_UPIU_REQUEST_SIZE; + u16 resp_len; +-- +2.20.1 + diff --git a/queue-4.14/series b/queue-4.14/series index 502fdfe184..e3436d1f83 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -9,3 +9,30 @@ ib-hfi1-silence-txreq-allocation-warnings.patch input-synaptics-enable-smbus-on-thinkpad-e480-and-e580.patch input-uinput-add-compat-ioctl-number-translation-for-ui_-_ff_upload.patch apparmor-enforce-nullbyte-at-end-of-tag-string.patch +arc-fix-build-warnings.patch +arc-plat-hsdk-add-missing-multicast-filter-bins-numb.patch +arc-plat-hsdk-add-missing-fifo-size-entry-in-gmac-no.patch +parport-fix-mem-leak-in-parport_register_dev_model.patch +parisc-fix-compiler-warnings-in-float-emulation-code.patch +ib-rdmavt-fix-alloc_qpn-warn_on.patch +ib-hfi1-insure-freeze_work-work_struct-is-canceled-o.patch +ib-qib-hfi1-rdmavt-correct-ibv_devinfo-max_mr-value.patch +ib-hfi1-validate-page-aligned-for-a-given-virtual-ad.patch +mips-uprobes-remove-set-but-not-used-variable-epc.patch +xtensa-fix-section-mismatch-between-memblock_reserve.patch +net-dsa-mv88e6xxx-avoid-error-message-on-remove-from.patch +net-hns-fix-loopback-test-failed-at-copper-ports.patch +mdesc-fix-a-missing-check-bug-in-get_vdev_port_node_.patch +sparc-perf-fix-updated-event-period-in-response-to-p.patch +net-ethernet-mediatek-use-hw_feature-to-judge-if-hwl.patch +net-ethernet-mediatek-use-net_ip_align-to-judge-if-h.patch +drm-arm-hdlcd-actually-validate-crtc-modes.patch +drm-arm-hdlcd-allow-a-bit-of-clock-tolerance.patch +scripts-checkstack.pl-fix-arm64-wrong-or-unknown-arc.patch +scsi-ufs-check-that-space-was-properly-alloced-in-co.patch +scsi-smartpqi-unlock-on-error-in-pqi_submit_raid_req.patch +net-ipvlan-fix-ipvlan-device-tso-disabled-while-neti.patch +s390-qeth-fix-vlan-attribute-in-bridge_hostnotify-ud.patch +hwmon-core-add-thermal-sensors-only-if-dev-of_node-i.patch +hwmon-pmbus-core-treat-parameters-as-paged-if-on-mul.patch +nvme-fix-u32-overflow-in-the-number-of-namespace-lis.patch diff --git a/queue-4.14/sparc-perf-fix-updated-event-period-in-response-to-p.patch b/queue-4.14/sparc-perf-fix-updated-event-period-in-response-to-p.patch new file mode 100644 index 0000000000..5f634eb396 --- /dev/null +++ b/queue-4.14/sparc-perf-fix-updated-event-period-in-response-to-p.patch @@ -0,0 +1,44 @@ +From 2186d6319b21610ee7b27fa3de3a02b53431ef73 Mon Sep 17 00:00:00 2001 +From: Young Xiao <92siuyang@gmail.com> +Date: Wed, 29 May 2019 10:21:48 +0800 +Subject: sparc: perf: fix updated event period in response to + PERF_EVENT_IOC_PERIOD + +[ Upstream commit 56cd0aefa475079e9613085b14a0f05037518fed ] + +The PERF_EVENT_IOC_PERIOD ioctl command can be used to change the +sample period of a running perf_event. Consequently, when calculating +the next event period, the new period will only be considered after the +previous one has overflowed. + +This patch changes the calculation of the remaining event ticks so that +they are offset if the period has changed. + +See commit 3581fe0ef37c ("ARM: 7556/1: perf: fix updated event period in +response to PERF_EVENT_IOC_PERIOD") for details. + +Signed-off-by: Young Xiao <92siuyang@gmail.com> +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + arch/sparc/kernel/perf_event.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c +index eceb0215bdee..58ea64a29d5f 100644 +--- a/arch/sparc/kernel/perf_event.c ++++ b/arch/sparc/kernel/perf_event.c +@@ -891,6 +891,10 @@ static int sparc_perf_event_set_period(struct perf_event *event, + s64 period = hwc->sample_period; + int ret = 0; + ++ /* The period may have been changed by PERF_EVENT_IOC_PERIOD */ ++ if (unlikely(period != hwc->last_period)) ++ left = period - (hwc->last_period - left); ++ + if (unlikely(left <= -period)) { + left = period; + local64_set(&hwc->period_left, left); +-- +2.20.1 + diff --git a/queue-4.14/xtensa-fix-section-mismatch-between-memblock_reserve.patch b/queue-4.14/xtensa-fix-section-mismatch-between-memblock_reserve.patch new file mode 100644 index 0000000000..079b756777 --- /dev/null +++ b/queue-4.14/xtensa-fix-section-mismatch-between-memblock_reserve.patch @@ -0,0 +1,50 @@ +From 76ce94052c9f42e3f0c5c0651cfb16ad04fa8d1e Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Thu, 30 May 2019 05:41:38 -0700 +Subject: xtensa: Fix section mismatch between memblock_reserve and mem_reserve + +[ Upstream commit adefd051a6707a6ca0ebad278d3c1c05c960fc3b ] + +Since commit 9012d011660ea5cf2 ("compiler: allow all arches to enable +CONFIG_OPTIMIZE_INLINING"), xtensa:tinyconfig fails to build with section +mismatch errors. + +WARNING: vmlinux.o(.text.unlikely+0x68): Section mismatch in reference + from the function ___pa() + to the function .meminit.text:memblock_reserve() +WARNING: vmlinux.o(.text.unlikely+0x74): Section mismatch in reference + from the function mem_reserve() + to the function .meminit.text:memblock_reserve() +FATAL: modpost: Section mismatches detected. + +This was not seen prior to the above mentioned commit because mem_reserve() +was always inlined. + +Mark mem_reserve(() as __init_memblock to have it reside in the same +section as memblock_reserve(). + +Signed-off-by: Guenter Roeck +Message-Id: <1559220098-9955-1-git-send-email-linux@roeck-us.net> +Signed-off-by: Max Filippov +Signed-off-by: Sasha Levin +--- + arch/xtensa/kernel/setup.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c +index 08175df7a69e..66eefe1919a4 100644 +--- a/arch/xtensa/kernel/setup.c ++++ b/arch/xtensa/kernel/setup.c +@@ -310,7 +310,8 @@ extern char _SecondaryResetVector_text_start; + extern char _SecondaryResetVector_text_end; + #endif + +-static inline int mem_reserve(unsigned long start, unsigned long end) ++static inline int __init_memblock mem_reserve(unsigned long start, ++ unsigned long end) + { + return memblock_reserve(start, end - start); + } +-- +2.20.1 + -- 2.39.2