From: Greg Kroah-Hartman Date: Tue, 18 Apr 2017 14:02:00 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.4.63~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c6ba98d39f91acf93b005f7cbdb80b6dce66de0;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: acpi-nfit-libnvdimm-fix-interleave-set-cookie-calculation-64-bit-comparison.patch acpi-scan-set-the-visited-flag-for-all-enumerated-devices.patch can-ifi-use-correct-register-to-read-rx-status.patch cpufreq-bring-cpus-up-even-if-cpufreq_online-failed.patch efi-fb-avoid-reconfiguration-of-bar-that-covers-the-framebuffer.patch efi-libstub-skip-gop-with-pixel_blt_only-format.patch ftrace-fix-removing-of-second-function-probe.patch irqchip-irq-imx-gpcv2-fix-spinlock-initialization.patch iscsi-target-drop-work-around-for-legacy-globalsan-initiator.patch iscsi-target-fix-tmr-reference-leak-during-session-shutdown.patch libnvdimm-fix-blk-free-space-accounting.patch libnvdimm-fix-reconfig_mutex-mmap_sem-and-jbd2_handle-lockdep-splat.patch make-skb_copy_datagram_msg-et.al.-preserve-msg_iter-on-error.patch new-privimitive-iov_iter_revert.patch parisc-fix-bugs-in-pa_memcpy.patch pwm-rockchip-state-of-pwm-clock-should-synchronize-with-pwm-enabled-state.patch scsi-qla2xxx-add-fix-to-read-correct-register-value-for-isp82xx.patch scsi-sd-consider-max_xfer_blocks-if-opt_xfer_blocks-is-unusable.patch scsi-sd-fix-capacity-calculation-with-32-bit-sector_t.patch scsi-sr-sanity-check-returned-mode-data.patch target-avoid-mappedlun-symlink-creation-during-lun-shutdown.patch xen-fbfront-fix-connecting-to-backend.patch --- diff --git a/queue-4.9/acpi-nfit-libnvdimm-fix-interleave-set-cookie-calculation-64-bit-comparison.patch b/queue-4.9/acpi-nfit-libnvdimm-fix-interleave-set-cookie-calculation-64-bit-comparison.patch new file mode 100644 index 00000000000..7aeb21f129e --- /dev/null +++ b/queue-4.9/acpi-nfit-libnvdimm-fix-interleave-set-cookie-calculation-64-bit-comparison.patch @@ -0,0 +1,42 @@ +From b03b99a329a14b7302f37c3ea6da3848db41c8c5 Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Mon, 27 Mar 2017 21:53:38 -0700 +Subject: acpi, nfit, libnvdimm: fix interleave set cookie calculation (64-bit comparison) + +From: Dan Williams + +commit b03b99a329a14b7302f37c3ea6da3848db41c8c5 upstream. + +While reviewing the -stable patch for commit 86ef58a4e35e "nfit, +libnvdimm: fix interleave set cookie calculation" Ben noted: + + "This is returning an int, thus it's effectively doing a 32-bit + comparison and not the 64-bit comparison you say is needed." + +Update the compare operation to be immune to this integer demotion problem. + +Cc: Nicholas Moulin +Fixes: 86ef58a4e35e ("nfit, libnvdimm: fix interleave set cookie calculation") +Reported-by: Ben Hutchings +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/nfit/core.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/acpi/nfit/core.c ++++ b/drivers/acpi/nfit/core.c +@@ -1617,7 +1617,11 @@ static int cmp_map(const void *m0, const + const struct nfit_set_info_map *map0 = m0; + const struct nfit_set_info_map *map1 = m1; + +- return map0->region_offset - map1->region_offset; ++ if (map0->region_offset < map1->region_offset) ++ return -1; ++ else if (map0->region_offset > map1->region_offset) ++ return 1; ++ return 0; + } + + /* Retrieve the nth entry referencing this spa */ diff --git a/queue-4.9/acpi-scan-set-the-visited-flag-for-all-enumerated-devices.patch b/queue-4.9/acpi-scan-set-the-visited-flag-for-all-enumerated-devices.patch new file mode 100644 index 00000000000..68b824e283f --- /dev/null +++ b/queue-4.9/acpi-scan-set-the-visited-flag-for-all-enumerated-devices.patch @@ -0,0 +1,55 @@ +From f406270bf73d71ea7b35ee3f7a08a44f6594c9b1 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Tue, 11 Apr 2017 00:23:42 +0200 +Subject: ACPI / scan: Set the visited flag for all enumerated devices + +From: Rafael J. Wysocki + +commit f406270bf73d71ea7b35ee3f7a08a44f6594c9b1 upstream. + +Commit 10c7e20b2ff3 (ACPI / scan: fix enumeration (visited) flags for +bus rescans) attempted to fix a problem with ACPI-based enumerateion +of I2C/SPI devices, but it forgot to ensure that the visited flag +will be set for all of the other enumerated devices, so fix that. + +Fixes: 10c7e20b2ff3 (ACPI / scan: fix enumeration (visited) flags for bus rescans) +Link: https://bugzilla.kernel.org/show_bug.cgi?id=194885 +Reported-and-tested-by: Kevin Locke +Signed-off-by: Rafael J. Wysocki +Reviewed-by: Mika Westerberg +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/scan.c | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -1827,15 +1827,20 @@ static void acpi_bus_attach(struct acpi_ + return; + + device->flags.match_driver = true; +- if (!ret) { +- ret = device_attach(&device->dev); +- if (ret < 0) +- return; +- +- if (!ret && device->pnp.type.platform_id) +- acpi_default_enumeration(device); ++ if (ret > 0) { ++ acpi_device_set_enumerated(device); ++ goto ok; + } + ++ ret = device_attach(&device->dev); ++ if (ret < 0) ++ return; ++ ++ if (ret > 0 || !device->pnp.type.platform_id) ++ acpi_device_set_enumerated(device); ++ else ++ acpi_default_enumeration(device); ++ + ok: + list_for_each_entry(child, &device->children, node) + acpi_bus_attach(child); diff --git a/queue-4.9/can-ifi-use-correct-register-to-read-rx-status.patch b/queue-4.9/can-ifi-use-correct-register-to-read-rx-status.patch new file mode 100644 index 00000000000..3de34890e22 --- /dev/null +++ b/queue-4.9/can-ifi-use-correct-register-to-read-rx-status.patch @@ -0,0 +1,30 @@ +From 57c1d4c33e8f7ec90976d79127059c1919cc0651 Mon Sep 17 00:00:00 2001 +From: Markus Marb +Date: Fri, 17 Mar 2017 23:14:47 +0100 +Subject: can: ifi: use correct register to read rx status + +From: Markus Marb + +commit 57c1d4c33e8f7ec90976d79127059c1919cc0651 upstream. + +The incorrect offset was used when trying to read the RXSTCMD register. + +Signed-off-by: Markus Marb +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/ifi_canfd/ifi_canfd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/can/ifi_canfd/ifi_canfd.c ++++ b/drivers/net/can/ifi_canfd/ifi_canfd.c +@@ -557,7 +557,7 @@ static int ifi_canfd_poll(struct napi_st + int work_done = 0; + + u32 stcmd = readl(priv->base + IFI_CANFD_STCMD); +- u32 rxstcmd = readl(priv->base + IFI_CANFD_STCMD); ++ u32 rxstcmd = readl(priv->base + IFI_CANFD_RXSTCMD); + u32 errctr = readl(priv->base + IFI_CANFD_ERROR_CTR); + + /* Handle bus state changes */ diff --git a/queue-4.9/cpufreq-bring-cpus-up-even-if-cpufreq_online-failed.patch b/queue-4.9/cpufreq-bring-cpus-up-even-if-cpufreq_online-failed.patch new file mode 100644 index 00000000000..311c15ca41d --- /dev/null +++ b/queue-4.9/cpufreq-bring-cpus-up-even-if-cpufreq_online-failed.patch @@ -0,0 +1,78 @@ +From c4a3fa261b16858416f1fd7db03a33d7ef5fc0b3 Mon Sep 17 00:00:00 2001 +From: Chen Yu +Date: Sun, 9 Apr 2017 13:45:16 +0800 +Subject: cpufreq: Bring CPUs up even if cpufreq_online() failed + +From: Chen Yu + +commit c4a3fa261b16858416f1fd7db03a33d7ef5fc0b3 upstream. + +There is a report that after commit 27622b061eb4 ("cpufreq: Convert +to hotplug state machine"), the normal CPU offline/online cycle +fails on some platforms. + +According to the ftrace result, this problem was triggered on +platforms using acpi-cpufreq as the default cpufreq driver, +and due to the lack of some ACPI freq method (eg. _PCT), +cpufreq_online() failed and returned a negative value, so the CPU +hotplug state machine rolled back the CPU online process. Actually, +from the user's perspective, the failure of cpufreq_online() should +not prevent that CPU from being brought up, although cpufreq might +not work on that CPU. + +BTW, during system startup cpufreq_online() is not invoked via CPU +online but by the cpufreq device creation process, so the APs can be +brought up even though cpufreq_online() fails in that stage. + +This patch ignores the return value of cpufreq_online/offline() and +lets the cpufreq framework deal with the failure. cpufreq_online() +itself will do a proper rollback in that case and if _PCT is missing, +the ACPI cpufreq driver will print a warning if the corresponding +debug options have been enabled. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=194581 +Fixes: 27622b061eb4 ("cpufreq: Convert to hotplug state machine") +Reported-and-tested-by: Tomasz Maciej Nowak +Signed-off-by: Chen Yu +Acked-by: Viresh Kumar +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cpufreq/cpufreq.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +--- a/drivers/cpufreq/cpufreq.c ++++ b/drivers/cpufreq/cpufreq.c +@@ -2404,6 +2404,20 @@ EXPORT_SYMBOL_GPL(cpufreq_boost_enabled) + *********************************************************************/ + static enum cpuhp_state hp_online; + ++static int cpuhp_cpufreq_online(unsigned int cpu) ++{ ++ cpufreq_online(cpu); ++ ++ return 0; ++} ++ ++static int cpuhp_cpufreq_offline(unsigned int cpu) ++{ ++ cpufreq_offline(cpu); ++ ++ return 0; ++} ++ + /** + * cpufreq_register_driver - register a CPU Frequency driver + * @driver_data: A struct cpufreq_driver containing the values# +@@ -2466,8 +2480,8 @@ int cpufreq_register_driver(struct cpufr + } + + ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "cpufreq:online", +- cpufreq_online, +- cpufreq_offline); ++ cpuhp_cpufreq_online, ++ cpuhp_cpufreq_offline); + if (ret < 0) + goto err_if_unreg; + hp_online = ret; diff --git a/queue-4.9/efi-fb-avoid-reconfiguration-of-bar-that-covers-the-framebuffer.patch b/queue-4.9/efi-fb-avoid-reconfiguration-of-bar-that-covers-the-framebuffer.patch new file mode 100644 index 00000000000..c9e96507fe3 --- /dev/null +++ b/queue-4.9/efi-fb-avoid-reconfiguration-of-bar-that-covers-the-framebuffer.patch @@ -0,0 +1,136 @@ +From 55d728a40d368ba80443be85c02e641fc9082a3f Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Tue, 4 Apr 2017 16:27:44 +0100 +Subject: efi/fb: Avoid reconfiguration of BAR that covers the framebuffer + +From: Ard Biesheuvel + +commit 55d728a40d368ba80443be85c02e641fc9082a3f upstream. + +On UEFI systems, the PCI subsystem is enumerated by the firmware, +and if a graphical framebuffer is exposed via a PCI device, its base +address and size are exposed to the OS via the Graphics Output +Protocol (GOP). + +On arm64 PCI systems, the entire PCI hierarchy is reconfigured from +scratch at boot. This may result in the GOP framebuffer address to +become stale, if the BAR covering the framebuffer is modified. This +will cause the framebuffer to become unresponsive, and may in some +cases result in unpredictable behavior if the range is reassigned to +another device. + +So add a non-x86 quirk to the EFI fb driver to find the BAR associated +with the GOP base address, and claim the BAR resource so that the PCI +core will not move it. + +Signed-off-by: Ard Biesheuvel +Cc: Linus Torvalds +Cc: Matt Fleming +Cc: Peter Jones +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: leif.lindholm@linaro.org +Cc: linux-efi@vger.kernel.org +Cc: lorenzo.pieralisi@arm.com +Fixes: 9822504c1fa5 ("efifb: Enable the efi-framebuffer platform driver ...") +Link: http://lkml.kernel.org/r/20170404152744.26687-3-ard.biesheuvel@linaro.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/video/fbdev/efifb.c | 66 +++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 65 insertions(+), 1 deletion(-) + +--- a/drivers/video/fbdev/efifb.c ++++ b/drivers/video/fbdev/efifb.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + #include + #include