From: Greg Kroah-Hartman Date: Sun, 19 Nov 2017 10:33:02 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v3.18.83~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66b3cd48b5adb52590e0bf05cd036da37d7cf7b0;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: alsa-hda-realtek-add-new-codec-id-alc299.patch alsa-vx-don-t-try-to-update-capture-stream-before-running.patch alsa-vx-fix-possible-transfer-overflow.patch arm-crypto-reduce-priority-of-bit-sliced-aes-cipher.patch arm-dts-fix-am335x-and-dm814x-scm-syscon-to-probe-children.patch arm-dts-fix-compatible-for-ti81xx-uarts-for-8250.patch arm-dts-fix-omap3-off-mode-pull-defines.patch arm-dts-omap5-uevm-allow-bootloader-to-configure-usb-ethernet-mac.patch arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch arm64-dts-ns2-reserve-memory-for-nitro-firmware.patch ata-ata_bmdma-should-depend-on-has_dma.patch ata-sata_highbank-should-depend-on-has_dma.patch ata-sata_mv-should-depend-on-has_dma.patch backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch backlight-lcd-fix-race-condition-during-register.patch bluetooth-btusb-fix-qca-rome-suspend-resume.patch drm-omap-panel-sony-acx565akm.c-add-module_alias.patch drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch extcon-remove-potential-problem-when-calling-extcon_register_notifier.patch fm10k-request-reset-when-mbx-state-changes.patch gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch igb-close-suspend-race-in-netif_device_detach.patch igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch igb-reset-the-phy-before-reading-the-phy-id.patch ixgbe-add-mask-for-64-rss-queues.patch ixgbe-configure-advertised-speeds-correctly-for-kr-kx-backplane.patch ixgbe-do-not-disable-fec-from-the-driver.patch ixgbe-fix-aer-error-handling.patch ixgbe-fix-reporting-of-100mb-capability.patch ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch ixgbe-reduce-i2c-retry-count-on-x550-devices.patch mips-end-asm-function-prologue-macros-with-.insn.patch mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch revert-crypto-xts-add-ecb-dependency.patch revert-dt-bindings-add-lego-mindstorms-ev3-compatible-specification.patch revert-dt-bindings-add-vendor-prefix-for-lego.patch revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch rtc-rx8010-change-lock-mechanism.patch scsi-lpfc-add-missing-memory-barrier.patch scsi-lpfc-clear-the-vendorversion-in-the-plogi-plogi-acc-payload.patch scsi-lpfc-correct-host-name-in-symbolic_name-field.patch scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch scsi-ufs-add-capability-to-keep-auto-bkops-always-enabled.patch scsi-ufs-qcom-fix-module-autoload.patch staging-greybus-add-host-device-function-pointer-checks.patch staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch staging-rtl8712-fixed-little-endian-problem.patch staging-wilc1000-fix-endian-sparse-warning.patch tcp-provide-timestamps-for-partial-writes.patch uapi-fix-linux-rds.h-userspace-compilation-error.patch uapi-fix-linux-rds.h-userspace-compilation-errors.patch x86-irq-trace-add-__irq_entry-annotation-to-x86-s-platform-irq-handlers.patch --- diff --git a/queue-4.9/alsa-hda-realtek-add-new-codec-id-alc299.patch b/queue-4.9/alsa-hda-realtek-add-new-codec-id-alc299.patch new file mode 100644 index 00000000000..640f009440e --- /dev/null +++ b/queue-4.9/alsa-hda-realtek-add-new-codec-id-alc299.patch @@ -0,0 +1,104 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Kailang Yang +Date: Wed, 4 Jan 2017 14:49:07 +0800 +Subject: ALSA: hda/realtek - Add new codec ID ALC299 + +From: Kailang Yang + + +[ Upstream commit 28f1f9b26cee161ddd3985b3eb78e3ffada08dda ] + +ALC299 was similar as ALC225. +Add headset support for ALC299. +ALC3271 was for Dell rename. + +Signed-off-by: Kailang Yang +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -338,6 +338,7 @@ static void alc_fill_eapd_coef(struct hd + case 0x10ec0288: + case 0x10ec0295: + case 0x10ec0298: ++ case 0x10ec0299: + alc_update_coef_idx(codec, 0x10, 1<<9, 0); + break; + case 0x10ec0285: +@@ -914,6 +915,7 @@ static struct alc_codec_rename_pci_table + { 0x10ec0256, 0x1028, 0, "ALC3246" }, + { 0x10ec0225, 0x1028, 0, "ALC3253" }, + { 0x10ec0295, 0x1028, 0, "ALC3254" }, ++ { 0x10ec0299, 0x1028, 0, "ALC3271" }, + { 0x10ec0670, 0x1025, 0, "ALC669X" }, + { 0x10ec0676, 0x1025, 0, "ALC679X" }, + { 0x10ec0282, 0x1043, 0, "ALC3229" }, +@@ -3721,6 +3723,7 @@ static void alc_headset_mode_unplugged(s + break; + case 0x10ec0225: + case 0x10ec0295: ++ case 0x10ec0299: + alc_process_coef_fw(codec, coef0225); + break; + case 0x10ec0867: +@@ -3829,6 +3832,7 @@ static void alc_headset_mode_mic_in(stru + break; + case 0x10ec0225: + case 0x10ec0295: ++ case 0x10ec0299: + alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); + snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); + alc_process_coef_fw(codec, coef0225); +@@ -3887,6 +3891,7 @@ static void alc_headset_mode_default(str + switch (codec->core.vendor_id) { + case 0x10ec0225: + case 0x10ec0295: ++ case 0x10ec0299: + alc_process_coef_fw(codec, coef0225); + break; + case 0x10ec0236: +@@ -4004,6 +4009,7 @@ static void alc_headset_mode_ctia(struct + break; + case 0x10ec0225: + case 0x10ec0295: ++ case 0x10ec0299: + alc_process_coef_fw(codec, coef0225); + break; + case 0x10ec0867: +@@ -4098,6 +4104,7 @@ static void alc_headset_mode_omtp(struct + break; + case 0x10ec0225: + case 0x10ec0295: ++ case 0x10ec0299: + alc_process_coef_fw(codec, coef0225); + break; + } +@@ -4183,6 +4190,7 @@ static void alc_determine_headset_type(s + break; + case 0x10ec0225: + case 0x10ec0295: ++ case 0x10ec0299: + alc_process_coef_fw(codec, coef0225); + msleep(800); + val = alc_read_coef_idx(codec, 0x46); +@@ -6251,6 +6259,7 @@ static int patch_alc269(struct hda_codec + break; + case 0x10ec0225: + case 0x10ec0295: ++ case 0x10ec0299: + spec->codec_variant = ALC269_TYPE_ALC225; + break; + case 0x10ec0234: +@@ -7249,6 +7258,7 @@ static const struct hda_device_id snd_hd + HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), + HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), + HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), ++ HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), + HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), + HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), + HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), diff --git a/queue-4.9/alsa-vx-don-t-try-to-update-capture-stream-before-running.patch b/queue-4.9/alsa-vx-don-t-try-to-update-capture-stream-before-running.patch new file mode 100644 index 00000000000..72cf987a066 --- /dev/null +++ b/queue-4.9/alsa-vx-don-t-try-to-update-capture-stream-before-running.patch @@ -0,0 +1,32 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Takashi Iwai +Date: Wed, 4 Jan 2017 12:34:14 +0100 +Subject: ALSA: vx: Don't try to update capture stream before running + +From: Takashi Iwai + + +[ Upstream commit ed3c177d960bb5881b945ca6f784868126bb90db ] + +The update of stream costs significantly, and we should avoid it +unless the stream really has started. Check pipe->running flag +instead of pipe->prepared. + +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + sound/drivers/vx/vx_pcm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/drivers/vx/vx_pcm.c ++++ b/sound/drivers/vx/vx_pcm.c +@@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(struct + int size, space, count; + struct snd_pcm_runtime *runtime = subs->runtime; + +- if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) ++ if (!pipe->running || (chip->chip_status & VX_STAT_IS_STALE)) + return; + + size = runtime->buffer_size - snd_pcm_capture_avail(runtime); diff --git a/queue-4.9/alsa-vx-fix-possible-transfer-overflow.patch b/queue-4.9/alsa-vx-fix-possible-transfer-overflow.patch new file mode 100644 index 00000000000..6ae02a78c1f --- /dev/null +++ b/queue-4.9/alsa-vx-fix-possible-transfer-overflow.patch @@ -0,0 +1,141 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Takashi Iwai +Date: Wed, 4 Jan 2017 12:19:15 +0100 +Subject: ALSA: vx: Fix possible transfer overflow + +From: Takashi Iwai + + +[ Upstream commit 874e1f6fad9a5184b67f4cee37c1335cd2cc5677 ] + +The pseudo DMA transfer codes in VX222 and VX-pocket driver have a +slight bug where they check the buffer boundary wrongly, and may +overflow. Also, the zero sample count might be handled badly for the +playback (although it shouldn't happen in theory). This patch +addresses these issues. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=141541 +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + sound/drivers/vx/vx_pcm.c | 6 ++++-- + sound/pci/vx222/vx222_ops.c | 12 ++++++------ + sound/pcmcia/vx/vxp_ops.c | 12 ++++++------ + 3 files changed, 16 insertions(+), 14 deletions(-) + +--- a/sound/drivers/vx/vx_pcm.c ++++ b/sound/drivers/vx/vx_pcm.c +@@ -1048,8 +1048,10 @@ static void vx_pcm_capture_update(struct + /* ok, let's accelerate! */ + int align = pipe->align * 3; + space = (count / align) * align; +- vx_pseudo_dma_read(chip, runtime, pipe, space); +- count -= space; ++ if (space > 0) { ++ vx_pseudo_dma_read(chip, runtime, pipe, space); ++ count -= space; ++ } + } + /* read the rest of bytes */ + while (count > 0) { +--- a/sound/pci/vx222/vx222_ops.c ++++ b/sound/pci/vx222/vx222_ops.c +@@ -269,12 +269,12 @@ static void vx2_dma_write(struct vx_core + + /* Transfer using pseudo-dma. + */ +- if (offset + count > pipe->buffer_bytes) { ++ if (offset + count >= pipe->buffer_bytes) { + int length = pipe->buffer_bytes - offset; + count -= length; + length >>= 2; /* in 32bit words */ + /* Transfer using pseudo-dma. */ +- while (length-- > 0) { ++ for (; length > 0; length--) { + outl(cpu_to_le32(*addr), port); + addr++; + } +@@ -284,7 +284,7 @@ static void vx2_dma_write(struct vx_core + pipe->hw_ptr += count; + count >>= 2; /* in 32bit words */ + /* Transfer using pseudo-dma. */ +- while (count-- > 0) { ++ for (; count > 0; count--) { + outl(cpu_to_le32(*addr), port); + addr++; + } +@@ -307,12 +307,12 @@ static void vx2_dma_read(struct vx_core + vx2_setup_pseudo_dma(chip, 0); + /* Transfer using pseudo-dma. + */ +- if (offset + count > pipe->buffer_bytes) { ++ if (offset + count >= pipe->buffer_bytes) { + int length = pipe->buffer_bytes - offset; + count -= length; + length >>= 2; /* in 32bit words */ + /* Transfer using pseudo-dma. */ +- while (length-- > 0) ++ for (; length > 0; length--) + *addr++ = le32_to_cpu(inl(port)); + addr = (u32 *)runtime->dma_area; + pipe->hw_ptr = 0; +@@ -320,7 +320,7 @@ static void vx2_dma_read(struct vx_core + pipe->hw_ptr += count; + count >>= 2; /* in 32bit words */ + /* Transfer using pseudo-dma. */ +- while (count-- > 0) ++ for (; count > 0; count--) + *addr++ = le32_to_cpu(inl(port)); + + vx2_release_pseudo_dma(chip); +--- a/sound/pcmcia/vx/vxp_ops.c ++++ b/sound/pcmcia/vx/vxp_ops.c +@@ -369,12 +369,12 @@ static void vxp_dma_write(struct vx_core + unsigned short *addr = (unsigned short *)(runtime->dma_area + offset); + + vx_setup_pseudo_dma(chip, 1); +- if (offset + count > pipe->buffer_bytes) { ++ if (offset + count >= pipe->buffer_bytes) { + int length = pipe->buffer_bytes - offset; + count -= length; + length >>= 1; /* in 16bit words */ + /* Transfer using pseudo-dma. */ +- while (length-- > 0) { ++ for (; length > 0; length--) { + outw(cpu_to_le16(*addr), port); + addr++; + } +@@ -384,7 +384,7 @@ static void vxp_dma_write(struct vx_core + pipe->hw_ptr += count; + count >>= 1; /* in 16bit words */ + /* Transfer using pseudo-dma. */ +- while (count-- > 0) { ++ for (; count > 0; count--) { + outw(cpu_to_le16(*addr), port); + addr++; + } +@@ -411,12 +411,12 @@ static void vxp_dma_read(struct vx_core + if (snd_BUG_ON(count % 2)) + return; + vx_setup_pseudo_dma(chip, 0); +- if (offset + count > pipe->buffer_bytes) { ++ if (offset + count >= pipe->buffer_bytes) { + int length = pipe->buffer_bytes - offset; + count -= length; + length >>= 1; /* in 16bit words */ + /* Transfer using pseudo-dma. */ +- while (length-- > 0) ++ for (; length > 0; length--) + *addr++ = le16_to_cpu(inw(port)); + addr = (unsigned short *)runtime->dma_area; + pipe->hw_ptr = 0; +@@ -424,7 +424,7 @@ static void vxp_dma_read(struct vx_core + pipe->hw_ptr += count; + count >>= 1; /* in 16bit words */ + /* Transfer using pseudo-dma. */ +- while (count-- > 1) ++ for (; count > 1; count--) + *addr++ = le16_to_cpu(inw(port)); + /* Disable DMA */ + pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK; diff --git a/queue-4.9/arm-crypto-reduce-priority-of-bit-sliced-aes-cipher.patch b/queue-4.9/arm-crypto-reduce-priority-of-bit-sliced-aes-cipher.patch new file mode 100644 index 00000000000..368b58da923 --- /dev/null +++ b/queue-4.9/arm-crypto-reduce-priority-of-bit-sliced-aes-cipher.patch @@ -0,0 +1,62 @@ +From ebiggers@google.com Sun Nov 19 11:20:08 2017 +From: Eric Biggers +Date: Fri, 17 Nov 2017 11:50:27 -0800 +Subject: [PATCH -stable] arm: crypto: reduce priority of bit-sliced AES cipher +To: stable@vger.kernel.org +Cc: Ard Biesheuvel , linux-crypto@vger.kernel.org, Eric Biggers +Message-ID: <20171117195027.88288-1-ebiggers@google.com> + +From: Eric Biggers + +[ Not upstream because this is a minimal fix for a bug where arm32 + kernels can use a much slower implementation of AES than is actually + available, potentially forcing vendors to disable encryption on their + devices.] + +All the aes-bs (bit-sliced) and aes-ce (cryptographic extensions) +algorithms had a priority of 300. This is undesirable because it means +an aes-bs algorithm may be used when an aes-ce algorithm is available. +The aes-ce algorithms have much better performance (up to 10x faster). + +Fix it by decreasing the priority of the aes-bs algorithms to 250. + +This was fixed upstream by commit cc477bf64573 ("crypto: arm/aes - +replace bit-sliced OpenSSL NEON code"), but it was just a small part of +a complete rewrite. This patch just fixes the priority bug for older +kernels. + +Signed-off-by: Eric Biggers +Acked-by: Ard Biesheuvel +--- + arch/arm/crypto/aesbs-glue.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/arm/crypto/aesbs-glue.c ++++ b/arch/arm/crypto/aesbs-glue.c +@@ -363,7 +363,7 @@ static struct crypto_alg aesbs_algs[] = + }, { + .cra_name = "cbc(aes)", + .cra_driver_name = "cbc-aes-neonbs", +- .cra_priority = 300, ++ .cra_priority = 250, + .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct async_helper_ctx), +@@ -383,7 +383,7 @@ static struct crypto_alg aesbs_algs[] = + }, { + .cra_name = "ctr(aes)", + .cra_driver_name = "ctr-aes-neonbs", +- .cra_priority = 300, ++ .cra_priority = 250, + .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC, + .cra_blocksize = 1, + .cra_ctxsize = sizeof(struct async_helper_ctx), +@@ -403,7 +403,7 @@ static struct crypto_alg aesbs_algs[] = + }, { + .cra_name = "xts(aes)", + .cra_driver_name = "xts-aes-neonbs", +- .cra_priority = 300, ++ .cra_priority = 250, + .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct async_helper_ctx), diff --git a/queue-4.9/arm-dts-fix-am335x-and-dm814x-scm-syscon-to-probe-children.patch b/queue-4.9/arm-dts-fix-am335x-and-dm814x-scm-syscon-to-probe-children.patch new file mode 100644 index 00000000000..f633568b17a --- /dev/null +++ b/queue-4.9/arm-dts-fix-am335x-and-dm814x-scm-syscon-to-probe-children.patch @@ -0,0 +1,51 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Tony Lindgren +Date: Thu, 5 Jan 2017 11:10:40 -0800 +Subject: ARM: dts: Fix am335x and dm814x scm syscon to probe children + +From: Tony Lindgren + + +[ Upstream commit 1aa09df0854efe16b7a80358a18f0a0bebafd246 ] + +Without these changes children of the scn syscon +won't probe. + +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/boot/dts/am33xx.dtsi | 3 ++- + arch/arm/boot/dts/dm814x.dtsi | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/am33xx.dtsi ++++ b/arch/arm/boot/dts/am33xx.dtsi +@@ -143,10 +143,11 @@ + }; + + scm_conf: scm_conf@0 { +- compatible = "syscon"; ++ compatible = "syscon", "simple-bus"; + reg = <0x0 0x800>; + #address-cells = <1>; + #size-cells = <1>; ++ ranges = <0 0 0x800>; + + scm_clocks: clocks { + #address-cells = <1>; +--- a/arch/arm/boot/dts/dm814x.dtsi ++++ b/arch/arm/boot/dts/dm814x.dtsi +@@ -332,10 +332,11 @@ + ranges = <0 0x140000 0x20000>; + + scm_conf: scm_conf@0 { +- compatible = "syscon"; ++ compatible = "syscon", "simple-bus"; + reg = <0x0 0x800>; + #address-cells = <1>; + #size-cells = <1>; ++ ranges = <0 0 0x800>; + + scm_clocks: clocks { + #address-cells = <1>; diff --git a/queue-4.9/arm-dts-fix-compatible-for-ti81xx-uarts-for-8250.patch b/queue-4.9/arm-dts-fix-compatible-for-ti81xx-uarts-for-8250.patch new file mode 100644 index 00000000000..70f3c5c36d1 --- /dev/null +++ b/queue-4.9/arm-dts-fix-compatible-for-ti81xx-uarts-for-8250.patch @@ -0,0 +1,79 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Tony Lindgren +Date: Thu, 5 Jan 2017 11:17:30 -0800 +Subject: ARM: dts: Fix compatible for ti81xx uarts for 8250 + +From: Tony Lindgren + + +[ Upstream commit f62280efe8934a1275fd148ef302d1afec8cd3df ] + +When using 8250_omap driver, we need to specify the right +compatible value for the UART to work on dm814x and dm816x. + +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/boot/dts/dm814x.dtsi | 6 +++--- + arch/arm/boot/dts/dm816x.dtsi | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +--- a/arch/arm/boot/dts/dm814x.dtsi ++++ b/arch/arm/boot/dts/dm814x.dtsi +@@ -252,7 +252,7 @@ + }; + + uart1: uart@20000 { +- compatible = "ti,omap3-uart"; ++ compatible = "ti,am3352-uart", "ti,omap3-uart"; + ti,hwmods = "uart1"; + reg = <0x20000 0x2000>; + clock-frequency = <48000000>; +@@ -262,7 +262,7 @@ + }; + + uart2: uart@22000 { +- compatible = "ti,omap3-uart"; ++ compatible = "ti,am3352-uart", "ti,omap3-uart"; + ti,hwmods = "uart2"; + reg = <0x22000 0x2000>; + clock-frequency = <48000000>; +@@ -272,7 +272,7 @@ + }; + + uart3: uart@24000 { +- compatible = "ti,omap3-uart"; ++ compatible = "ti,am3352-uart", "ti,omap3-uart"; + ti,hwmods = "uart3"; + reg = <0x24000 0x2000>; + clock-frequency = <48000000>; +--- a/arch/arm/boot/dts/dm816x.dtsi ++++ b/arch/arm/boot/dts/dm816x.dtsi +@@ -371,7 +371,7 @@ + }; + + uart1: uart@48020000 { +- compatible = "ti,omap3-uart"; ++ compatible = "ti,am3352-uart", "ti,omap3-uart"; + ti,hwmods = "uart1"; + reg = <0x48020000 0x2000>; + clock-frequency = <48000000>; +@@ -381,7 +381,7 @@ + }; + + uart2: uart@48022000 { +- compatible = "ti,omap3-uart"; ++ compatible = "ti,am3352-uart", "ti,omap3-uart"; + ti,hwmods = "uart2"; + reg = <0x48022000 0x2000>; + clock-frequency = <48000000>; +@@ -391,7 +391,7 @@ + }; + + uart3: uart@48024000 { +- compatible = "ti,omap3-uart"; ++ compatible = "ti,am3352-uart", "ti,omap3-uart"; + ti,hwmods = "uart3"; + reg = <0x48024000 0x2000>; + clock-frequency = <48000000>; diff --git a/queue-4.9/arm-dts-fix-omap3-off-mode-pull-defines.patch b/queue-4.9/arm-dts-fix-omap3-off-mode-pull-defines.patch new file mode 100644 index 00000000000..ffc2b746748 --- /dev/null +++ b/queue-4.9/arm-dts-fix-omap3-off-mode-pull-defines.patch @@ -0,0 +1,43 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Tony Lindgren +Date: Thu, 5 Jan 2017 11:07:18 -0800 +Subject: ARM: dts: Fix omap3 off mode pull defines + +From: Tony Lindgren + + +[ Upstream commit d97556c8012015901a3ce77f46960078139cd79d ] + +We need to also have OFFPULLUDENABLE bit set to use the off mode pull values. +Otherwise the line is pulled down internally if no external pull exists. + +This is has some documentation at: + +http://processors.wiki.ti.com/index.php/Optimizing_OMAP35x_and_AM/DM37x_OFF_mode_PAD_configuration + +Note that the value is still glitchy during off mode transitions as documented +in spz319f.pdf "Advisory 1.45". It's best to use external pulls instead of +relying on the internal ones for off mode and even then anything pulled up +will get driven down momentarily on off mode restore for GPIO banks other +than bank1. + +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + include/dt-bindings/pinctrl/omap.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/include/dt-bindings/pinctrl/omap.h ++++ b/include/dt-bindings/pinctrl/omap.h +@@ -45,8 +45,8 @@ + #define PIN_OFF_NONE 0 + #define PIN_OFF_OUTPUT_HIGH (OFF_EN | OFFOUT_EN | OFFOUT_VAL) + #define PIN_OFF_OUTPUT_LOW (OFF_EN | OFFOUT_EN) +-#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFF_PULL_EN | OFF_PULL_UP) +-#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) ++#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFFOUT_EN | OFF_PULL_EN | OFF_PULL_UP) ++#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFFOUT_EN | OFF_PULL_EN) + #define PIN_OFF_WAKEUPENABLE WAKEUP_EN + + /* diff --git a/queue-4.9/arm-dts-omap5-uevm-allow-bootloader-to-configure-usb-ethernet-mac.patch b/queue-4.9/arm-dts-omap5-uevm-allow-bootloader-to-configure-usb-ethernet-mac.patch new file mode 100644 index 00000000000..6a3e6a402a1 --- /dev/null +++ b/queue-4.9/arm-dts-omap5-uevm-allow-bootloader-to-configure-usb-ethernet-mac.patch @@ -0,0 +1,68 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Tony Lindgren +Date: Thu, 5 Jan 2017 08:37:02 -0800 +Subject: ARM: dts: omap5-uevm: Allow bootloader to configure USB Ethernet MAC + +From: Tony Lindgren + + +[ Upstream commit e13a22a406f20322651b8c0847f4210bdef246d1 ] + +Note that with 9730 the wiring is different compared to 9514 found on +beagleboard xm for example. + +On beagleboard xm we have: + +/sys/bus/usb/devices/1-2 hub +/sys/bus/usb/devices/1-2.1 9514 + +While on omap5-uevm we have: + +/sys/bus/usb/devices/1-2 hub +/sys/bus/usb/devices/1-3 9730 + +Cc: Laurent Pinchart +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/boot/dts/omap5-uevm.dts | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +--- a/arch/arm/boot/dts/omap5-uevm.dts ++++ b/arch/arm/boot/dts/omap5-uevm.dts +@@ -18,6 +18,10 @@ + reg = <0 0x80000000 0 0x7f000000>; /* 2032 MB */ + }; + ++ aliases { ++ ethernet = ðernet; ++ }; ++ + leds { + compatible = "gpio-leds"; + led1 { +@@ -72,6 +76,23 @@ + >; + }; + ++&usbhsehci { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ hub@2 { ++ compatible = "usb424,3503"; ++ reg = <2>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ ++ ethernet: usbether@3 { ++ compatible = "usb424,9730"; ++ reg = <3>; ++ }; ++}; ++ + &wlcore { + compatible = "ti,wl1837"; + }; diff --git a/queue-4.9/arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch b/queue-4.9/arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch new file mode 100644 index 00000000000..ba7fda72a22 --- /dev/null +++ b/queue-4.9/arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch @@ -0,0 +1,30 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Tony Lindgren +Date: Thu, 5 Jan 2017 11:08:20 -0800 +Subject: ARM: OMAP2+: Fix init for multiple quirks for the same SoC + +From: Tony Lindgren + + +[ Upstream commit 6e613ebf4405fc09e2a8c16ed193b47f80a3cbed ] + +It's possible that there are multiple quirks that need to be initialized +for the same SoC. Fix the issue by not returning on the first match. + +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/mach-omap2/pdata-quirks.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/arm/mach-omap2/pdata-quirks.c ++++ b/arch/arm/mach-omap2/pdata-quirks.c +@@ -600,7 +600,6 @@ static void pdata_quirks_check(struct pd + if (of_machine_is_compatible(quirks->compatible)) { + if (quirks->fn) + quirks->fn(); +- break; + } + quirks++; + } diff --git a/queue-4.9/arm64-dts-ns2-reserve-memory-for-nitro-firmware.patch b/queue-4.9/arm64-dts-ns2-reserve-memory-for-nitro-firmware.patch new file mode 100644 index 00000000000..0cc5aec1caa --- /dev/null +++ b/queue-4.9/arm64-dts-ns2-reserve-memory-for-nitro-firmware.patch @@ -0,0 +1,33 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Jon Mason +Date: Mon, 5 Dec 2016 18:12:21 -0500 +Subject: arm64: dts: NS2: reserve memory for Nitro firmware + +From: Jon Mason + + +[ Upstream commit 0cc878d678444392ca2a31350f89f489593ef5bb ] + +Nitro firmware is loaded into memory by the bootloader at a specific +location. Set this memory range aside to prevent the kernel from using +it. + +Signed-off-by: Jon Mason +Signed-off-by: Florian Fainelli +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/boot/dts/broadcom/ns2.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm64/boot/dts/broadcom/ns2.dtsi ++++ b/arch/arm64/boot/dts/broadcom/ns2.dtsi +@@ -30,6 +30,8 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + ++/memreserve/ 0x81000000 0x00200000; ++ + #include + #include + diff --git a/queue-4.9/ata-ata_bmdma-should-depend-on-has_dma.patch b/queue-4.9/ata-ata_bmdma-should-depend-on-has_dma.patch new file mode 100644 index 00000000000..abf375cafca --- /dev/null +++ b/queue-4.9/ata-ata_bmdma-should-depend-on-has_dma.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Geert Uytterhoeven +Date: Tue, 3 Jan 2017 19:09:46 +0100 +Subject: ata: ATA_BMDMA should depend on HAS_DMA + +From: Geert Uytterhoeven + + +[ Upstream commit 7bc7ab1e63dfe004931502f90ce7020e375623da ] + +If NO_DMA=y: + + ERROR: "dmam_alloc_coherent" [drivers/ata/libata.ko] undefined! + +Add a dependency on HAS_DMA to fix this. + +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Tejun Heo +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ata/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/ata/Kconfig ++++ b/drivers/ata/Kconfig +@@ -289,6 +289,7 @@ config SATA_SX4 + + config ATA_BMDMA + bool "ATA BMDMA support" ++ depends on HAS_DMA + default y + help + This option adds support for SFF ATA controllers with BMDMA diff --git a/queue-4.9/ata-sata_highbank-should-depend-on-has_dma.patch b/queue-4.9/ata-sata_highbank-should-depend-on-has_dma.patch new file mode 100644 index 00000000000..7412d51785d --- /dev/null +++ b/queue-4.9/ata-sata_highbank-should-depend-on-has_dma.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Geert Uytterhoeven +Date: Tue, 3 Jan 2017 19:09:45 +0100 +Subject: ata: SATA_HIGHBANK should depend on HAS_DMA + +From: Geert Uytterhoeven + + +[ Upstream commit 2a736e0585e585c2566b5119af8381910a170e44 ] + +If NO_DMA=y: + + ERROR: "bad_dma_ops" [drivers/ata/sata_highbank.ko] undefined! + +Add a dependency on HAS_DMA to fix this. + +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Tejun Heo +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ata/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/ata/Kconfig ++++ b/drivers/ata/Kconfig +@@ -345,6 +345,7 @@ config SATA_DWC_VDEBUG + + config SATA_HIGHBANK + tristate "Calxeda Highbank SATA support" ++ depends on HAS_DMA + depends on ARCH_HIGHBANK || COMPILE_TEST + help + This option enables support for the Calxeda Highbank SoC's diff --git a/queue-4.9/ata-sata_mv-should-depend-on-has_dma.patch b/queue-4.9/ata-sata_mv-should-depend-on-has_dma.patch new file mode 100644 index 00000000000..c9f39420c3e --- /dev/null +++ b/queue-4.9/ata-sata_mv-should-depend-on-has_dma.patch @@ -0,0 +1,36 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Geert Uytterhoeven +Date: Tue, 3 Jan 2017 19:09:44 +0100 +Subject: ata: SATA_MV should depend on HAS_DMA + +From: Geert Uytterhoeven + + +[ Upstream commit 62989cebd367a1aae1e009e1a5b1ec046a4c8fdc ] + +If NO_DMA=y: + + ERROR: "dma_pool_alloc" [drivers/ata/sata_mv.ko] undefined! + ERROR: "dmam_pool_create" [drivers/ata/sata_mv.ko] undefined! + ERROR: "dma_pool_free" [drivers/ata/sata_mv.ko] undefined! + +Add a dependency on HAS_DMA to fix this. + +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Tejun Heo +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ata/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/ata/Kconfig ++++ b/drivers/ata/Kconfig +@@ -355,6 +355,7 @@ config SATA_HIGHBANK + + config SATA_MV + tristate "Marvell SATA support" ++ depends on HAS_DMA + depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \ + ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST + select GENERIC_PHY diff --git a/queue-4.9/backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch b/queue-4.9/backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch new file mode 100644 index 00000000000..02e8208e3ec --- /dev/null +++ b/queue-4.9/backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch @@ -0,0 +1,48 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Alexey Khoroshilov +Date: Sat, 9 Jul 2016 01:19:51 +0300 +Subject: backlight: adp5520: Fix error handling in adp5520_bl_probe() + +From: Alexey Khoroshilov + + +[ Upstream commit 0eb3fba8c68275f0122f65f7316efaaf86448016 ] + +If adp5520_bl_setup() fails, sysfs group left unremoved. + +By the way, fix overcomplicated assignement of error code. + +Found by Linux Driver Verification project (linuxtesting.org). + +Signed-off-by: Alexey Khoroshilov +Acked-by: Michael Hennerich +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/video/backlight/adp5520_bl.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/video/backlight/adp5520_bl.c ++++ b/drivers/video/backlight/adp5520_bl.c +@@ -332,10 +332,18 @@ static int adp5520_bl_probe(struct platf + } + + platform_set_drvdata(pdev, bl); +- ret |= adp5520_bl_setup(bl); ++ ret = adp5520_bl_setup(bl); ++ if (ret) { ++ dev_err(&pdev->dev, "failed to setup\n"); ++ if (data->pdata->en_ambl_sens) ++ sysfs_remove_group(&bl->dev.kobj, ++ &adp5520_bl_attr_group); ++ return ret; ++ } ++ + backlight_update_status(bl); + +- return ret; ++ return 0; + } + + static int adp5520_bl_remove(struct platform_device *pdev) diff --git a/queue-4.9/backlight-lcd-fix-race-condition-during-register.patch b/queue-4.9/backlight-lcd-fix-race-condition-during-register.patch new file mode 100644 index 00000000000..5231e95d3ca --- /dev/null +++ b/queue-4.9/backlight-lcd-fix-race-condition-during-register.patch @@ -0,0 +1,43 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Uwe Kleine-König +Date: Wed, 6 Jul 2016 19:33:05 +0200 +Subject: backlight: lcd: Fix race condition during register + +From: Uwe Kleine-König + + +[ Upstream commit cc21942bce652d1a92dae85b785378256e1df1f7 ] + +Once device_register is called for a device its attributes might be +accessed. As the callbacks of a lcd device's attributes make use of the +lcd_ops, the respective member must be setup before calling +device_register. + +Signed-off-by: Uwe Kleine-König +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/video/backlight/lcd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/video/backlight/lcd.c ++++ b/drivers/video/backlight/lcd.c +@@ -226,6 +226,8 @@ struct lcd_device *lcd_device_register(c + dev_set_name(&new_ld->dev, "%s", name); + dev_set_drvdata(&new_ld->dev, devdata); + ++ new_ld->ops = ops; ++ + rc = device_register(&new_ld->dev); + if (rc) { + put_device(&new_ld->dev); +@@ -238,8 +240,6 @@ struct lcd_device *lcd_device_register(c + return ERR_PTR(rc); + } + +- new_ld->ops = ops; +- + return new_ld; + } + EXPORT_SYMBOL(lcd_device_register); diff --git a/queue-4.9/bluetooth-btusb-fix-qca-rome-suspend-resume.patch b/queue-4.9/bluetooth-btusb-fix-qca-rome-suspend-resume.patch new file mode 100644 index 00000000000..aa74529b304 --- /dev/null +++ b/queue-4.9/bluetooth-btusb-fix-qca-rome-suspend-resume.patch @@ -0,0 +1,38 @@ +From fd865802c66bc451dc515ed89360f84376ce1a56 Mon Sep 17 00:00:00 2001 +From: Leif Liddy +Date: Sat, 8 Jul 2017 20:55:32 +0200 +Subject: Bluetooth: btusb: fix QCA Rome suspend/resume + +From: Leif Liddy + +commit fd865802c66bc451dc515ed89360f84376ce1a56 upstream. + +There's been numerous reported instances where BTUSB_QCA_ROME +bluetooth controllers stop functioning upon resume from suspend. These +devices seem to be losing power during suspend. Patch will detect a status +change on resume and perform a reset. + +Signed-off-by: Leif Liddy +Signed-off-by: Marcel Holtmann +Cc: Kai Heng Feng +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/bluetooth/btusb.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -2925,6 +2925,12 @@ static int btusb_probe(struct usb_interf + if (id->driver_info & BTUSB_QCA_ROME) { + data->setup_on_usb = btusb_setup_qca; + hdev->set_bdaddr = btusb_set_bdaddr_ath3012; ++ ++ /* QCA Rome devices lose their updated firmware over suspend, ++ * but the USB hub doesn't notice any status change. ++ * Explicitly request a device reset on resume. ++ */ ++ set_bit(BTUSB_RESET_RESUME, &data->flags); + } + + #ifdef CONFIG_BT_HCIBTUSB_RTL diff --git a/queue-4.9/drm-omap-panel-sony-acx565akm.c-add-module_alias.patch b/queue-4.9/drm-omap-panel-sony-acx565akm.c-add-module_alias.patch new file mode 100644 index 00000000000..c3bc3c4b882 --- /dev/null +++ b/queue-4.9/drm-omap-panel-sony-acx565akm.c-add-module_alias.patch @@ -0,0 +1,31 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Jarkko Nikula +Date: Tue, 27 Dec 2016 22:12:16 +0200 +Subject: drm/omap: panel-sony-acx565akm.c: Add MODULE_ALIAS + +From: Jarkko Nikula + + +[ Upstream commit 42f7f3c4811b3149253ecf2e133832c969884466 ] + +Add module alias for Sony ACX565AKM LCD panel. This makes it probe on Nokia +N900 when panel driver is built as a module. + +Signed-off-by: Jarkko Nikula +Signed-off-by: Tomi Valkeinen +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c ++++ b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +@@ -912,6 +912,7 @@ static struct spi_driver acx565akm_drive + + module_spi_driver(acx565akm_driver); + ++MODULE_ALIAS("spi:sony,acx565akm"); + MODULE_AUTHOR("Nokia Corporation"); + MODULE_DESCRIPTION("acx565akm LCD Driver"); + MODULE_LICENSE("GPL"); diff --git a/queue-4.9/drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch b/queue-4.9/drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch new file mode 100644 index 00000000000..d354a6368b8 --- /dev/null +++ b/queue-4.9/drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch @@ -0,0 +1,35 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Arvind Yadav +Date: Wed, 21 Dec 2016 11:00:12 +0530 +Subject: drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache + +From: Arvind Yadav + + +[ Upstream commit 1ae0d5af347df224a6e76334683f13a96d915a44 ] + +Here, If devm_ioremap_nocache will fail. It will return NULL. +Kernel can run into a NULL-pointer dereference. This error check +will avoid NULL pointer dereference. + +Signed-off-by: Arvind Yadav +Acked-by: Vincent Abriou +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/sti/sti_vtg.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/sti/sti_vtg.c ++++ b/drivers/gpu/drm/sti/sti_vtg.c +@@ -429,6 +429,10 @@ static int vtg_probe(struct platform_dev + return -ENOMEM; + } + vtg->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); ++ if (!vtg->regs) { ++ DRM_ERROR("failed to remap I/O memory\n"); ++ return -ENOMEM; ++ } + + np = of_parse_phandle(pdev->dev.of_node, "st,slave", 0); + if (np) { diff --git a/queue-4.9/extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch b/queue-4.9/extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch new file mode 100644 index 00000000000..dfffebc06e5 --- /dev/null +++ b/queue-4.9/extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch @@ -0,0 +1,38 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Roger Quadros +Date: Thu, 8 Dec 2016 10:45:31 +0200 +Subject: extcon: palmas: Check the parent instance to prevent the NULL + +From: Roger Quadros + + +[ Upstream commit 9fe172b9be532acc23e35ba693700383ab775e66 ] + +extcon-palmas must be child of palmas and expects parent's +drvdata to be valid. Check for non NULL parent drvdata and +fail if it is NULL. Not doing so will result in a NULL +pointer dereference later in the probe() parent drvdata +is NULL (e.g. misplaced extcon-palmas node in device tree). + +Signed-off-by: Roger Quadros +Signed-off-by: Chanwoo Choi +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/extcon/extcon-palmas.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/extcon/extcon-palmas.c ++++ b/drivers/extcon/extcon-palmas.c +@@ -190,6 +190,11 @@ static int palmas_usb_probe(struct platf + struct palmas_usb *palmas_usb; + int status; + ++ if (!palmas) { ++ dev_err(&pdev->dev, "failed to get valid parent\n"); ++ return -EINVAL; ++ } ++ + palmas_usb = devm_kzalloc(&pdev->dev, sizeof(*palmas_usb), GFP_KERNEL); + if (!palmas_usb) + return -ENOMEM; diff --git a/queue-4.9/extcon-remove-potential-problem-when-calling-extcon_register_notifier.patch b/queue-4.9/extcon-remove-potential-problem-when-calling-extcon_register_notifier.patch new file mode 100644 index 00000000000..91b233d16a4 --- /dev/null +++ b/queue-4.9/extcon-remove-potential-problem-when-calling-extcon_register_notifier.patch @@ -0,0 +1,69 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Chanwoo Choi +Date: Mon, 19 Dec 2016 21:02:33 +0900 +Subject: extcon: Remove potential problem when calling extcon_register_notifier() + +From: Chanwoo Choi + + +[ Upstream commit 01b4c9a1ae07a25d208cad0da7dd288007a22984 ] + +This patch removes the potential problem of extcon_register_notifier() +when edev parameter is NULL. When edev is NULL, this function returns +the first extcon device which includes the sepecific external connector +of second paramter. But, it don't guarantee the same operation in all cases. +To remove this confusion and potential problem, this patch fixes it. + +Signed-off-by: Chanwoo Choi +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/extcon/extcon.c | 35 ++++++++--------------------------- + 1 file changed, 8 insertions(+), 27 deletions(-) + +--- a/drivers/extcon/extcon.c ++++ b/drivers/extcon/extcon.c +@@ -906,35 +906,16 @@ int extcon_register_notifier(struct extc + unsigned long flags; + int ret, idx = -EINVAL; + +- if (!nb) ++ if (!edev || !nb) + return -EINVAL; + +- if (edev) { +- idx = find_cable_index_by_id(edev, id); +- if (idx < 0) +- return idx; +- +- spin_lock_irqsave(&edev->lock, flags); +- ret = raw_notifier_chain_register(&edev->nh[idx], nb); +- spin_unlock_irqrestore(&edev->lock, flags); +- } else { +- struct extcon_dev *extd; +- +- mutex_lock(&extcon_dev_list_lock); +- list_for_each_entry(extd, &extcon_dev_list, entry) { +- idx = find_cable_index_by_id(extd, id); +- if (idx >= 0) +- break; +- } +- mutex_unlock(&extcon_dev_list_lock); +- +- if (idx >= 0) { +- edev = extd; +- return extcon_register_notifier(extd, id, nb); +- } else { +- ret = -ENODEV; +- } +- } ++ idx = find_cable_index_by_id(edev, id); ++ if (idx < 0) ++ return idx; ++ ++ spin_lock_irqsave(&edev->lock, flags); ++ ret = raw_notifier_chain_register(&edev->nh[idx], nb); ++ spin_unlock_irqrestore(&edev->lock, flags); + + return ret; + } diff --git a/queue-4.9/fm10k-request-reset-when-mbx-state-changes.patch b/queue-4.9/fm10k-request-reset-when-mbx-state-changes.patch new file mode 100644 index 00000000000..ad192f45828 --- /dev/null +++ b/queue-4.9/fm10k-request-reset-when-mbx-state-changes.patch @@ -0,0 +1,101 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Ngai-Mint Kwan +Date: Wed, 2 Nov 2016 16:44:46 -0700 +Subject: fm10k: request reset when mbx->state changes + +From: Ngai-Mint Kwan + + +[ Upstream commit 2f3fc1e6200309ccf87f61dea56e57e563c4f800 ] + +Multiple IES API resets can cause a race condition where the mailbox +interrupt request bits can be cleared before being handled. This can +leave certain mailbox messages from the PF to be untreated and the PF +will enter in some inactive state. If this situation occurs, the IES API +will initiate a mailbox version reset which, then, trigger a mailbox +state change. Once this mailbox transition occurs (from OPEN to CONNECT +state), a request for reset will be returned. + +This ensures that PF will undergo a reset whenever IES API encounters an +unknown global mailbox interrupt event or whenever the IES API +terminates. + +Signed-off-by: Ngai-Mint Kwan +Signed-off-by: Jacob Keller +Tested-by: Krishneil Singh +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/fm10k/fm10k_mbx.c | 10 +++++++--- + drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 6 +++++- + 2 files changed, 12 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c ++++ b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c +@@ -2011,9 +2011,10 @@ static void fm10k_sm_mbx_create_reply(st + * function can also be used to respond to an error as the connection + * resetting would also be a means of dealing with errors. + **/ +-static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, +- struct fm10k_mbx_info *mbx) ++static s32 fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, ++ struct fm10k_mbx_info *mbx) + { ++ s32 err = 0; + const enum fm10k_mbx_state state = mbx->state; + + switch (state) { +@@ -2026,6 +2027,7 @@ static void fm10k_sm_mbx_process_reset(s + case FM10K_STATE_OPEN: + /* flush any incomplete work */ + fm10k_sm_mbx_connect_reset(mbx); ++ err = FM10K_ERR_RESET_REQUESTED; + break; + case FM10K_STATE_CONNECT: + /* Update remote value to match local value */ +@@ -2035,6 +2037,8 @@ static void fm10k_sm_mbx_process_reset(s + } + + fm10k_sm_mbx_create_reply(hw, mbx, mbx->tail); ++ ++ return err; + } + + /** +@@ -2115,7 +2119,7 @@ static s32 fm10k_sm_mbx_process(struct f + + switch (FM10K_MSG_HDR_FIELD_GET(mbx->mbx_hdr, SM_VER)) { + case 0: +- fm10k_sm_mbx_process_reset(hw, mbx); ++ err = fm10k_sm_mbx_process_reset(hw, mbx); + break; + case FM10K_SM_MBX_VERSION: + err = fm10k_sm_mbx_process_version_1(hw, mbx); +--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c ++++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c +@@ -1144,6 +1144,7 @@ static irqreturn_t fm10k_msix_mbx_pf(int + struct fm10k_hw *hw = &interface->hw; + struct fm10k_mbx_info *mbx = &hw->mbx; + u32 eicr; ++ s32 err = 0; + + /* unmask any set bits related to this interrupt */ + eicr = fm10k_read_reg(hw, FM10K_EICR); +@@ -1159,12 +1160,15 @@ static irqreturn_t fm10k_msix_mbx_pf(int + + /* service mailboxes */ + if (fm10k_mbx_trylock(interface)) { +- mbx->ops.process(hw, mbx); ++ err = mbx->ops.process(hw, mbx); + /* handle VFLRE events */ + fm10k_iov_event(interface); + fm10k_mbx_unlock(interface); + } + ++ if (err == FM10K_ERR_RESET_REQUESTED) ++ interface->flags |= FM10K_FLAG_RESET_REQUESTED; ++ + /* if switch toggled state we should reset GLORTs */ + if (eicr & FM10K_EICR_SWITCHNOTREADY) { + /* force link down for at least 4 seconds */ diff --git a/queue-4.9/gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch b/queue-4.9/gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch new file mode 100644 index 00000000000..97e601b6a4c --- /dev/null +++ b/queue-4.9/gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch @@ -0,0 +1,32 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Arvind Yadav +Date: Tue, 3 Jan 2017 17:00:27 +0530 +Subject: gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap + +From: Arvind Yadav + + +[ Upstream commit 4b0ea93f250afc6c1128e201b0a8a115ae613e47 ] + +Here, pci_iomap can fail, handle this case and return -ENOMEM. + +Signed-off-by: Arvind Yadav +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1483443027-13444-1-git-send-email-arvind.yadav.cs@gmail.com +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/mgag200/mgag200_main.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/gpu/drm/mgag200/mgag200_main.c ++++ b/drivers/gpu/drm/mgag200/mgag200_main.c +@@ -145,6 +145,8 @@ static int mga_vram_init(struct mga_devi + } + + mem = pci_iomap(mdev->dev->pdev, 0, 0); ++ if (!mem) ++ return -ENOMEM; + + mdev->mc.vram_size = mga_probe_vram(mdev, mem); + diff --git a/queue-4.9/igb-close-suspend-race-in-netif_device_detach.patch b/queue-4.9/igb-close-suspend-race-in-netif_device_detach.patch new file mode 100644 index 00000000000..0794928efc9 --- /dev/null +++ b/queue-4.9/igb-close-suspend-race-in-netif_device_detach.patch @@ -0,0 +1,85 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Todd Fujinaka +Date: Tue, 15 Nov 2016 08:54:26 -0800 +Subject: igb: close/suspend race in netif_device_detach + +From: Todd Fujinaka + + +[ Upstream commit 9474933caf21a4cb5147223dca1551f527aaac36 ] + +Similar to ixgbe, when an interface is part of a namespace it is +possible that igb_close() may be called while __igb_shutdown() is +running which ends up in a double free WARN and/or a BUG in +free_msi_irqs(). + +Extend the rtnl_lock() to protect the call to netif_device_detach() and +igb_clear_interrupt_scheme() in __igb_shutdown() and check for +netif_device_present() to avoid calling igb_clear_interrupt_scheme() a +second time in igb_close(). + +Also extend the rtnl lock in igb_resume() to netif_device_attach(). + +Signed-off-by: Todd Fujinaka +Acked-by: Alexander Duyck +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/igb/igb_main.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +--- a/drivers/net/ethernet/intel/igb/igb_main.c ++++ b/drivers/net/ethernet/intel/igb/igb_main.c +@@ -3271,7 +3271,9 @@ static int __igb_close(struct net_device + + int igb_close(struct net_device *netdev) + { +- return __igb_close(netdev, false); ++ if (netif_device_present(netdev)) ++ return __igb_close(netdev, false); ++ return 0; + } + + /** +@@ -7548,6 +7550,7 @@ static int __igb_shutdown(struct pci_dev + int retval = 0; + #endif + ++ rtnl_lock(); + netif_device_detach(netdev); + + if (netif_running(netdev)) +@@ -7556,6 +7559,7 @@ static int __igb_shutdown(struct pci_dev + igb_ptp_suspend(adapter); + + igb_clear_interrupt_scheme(adapter); ++ rtnl_unlock(); + + #ifdef CONFIG_PM + retval = pci_save_state(pdev); +@@ -7674,16 +7678,15 @@ static int igb_resume(struct device *dev + + wr32(E1000_WUS, ~0); + +- if (netdev->flags & IFF_UP) { +- rtnl_lock(); ++ rtnl_lock(); ++ if (!err && netif_running(netdev)) + err = __igb_open(netdev, true); +- rtnl_unlock(); +- if (err) +- return err; +- } + +- netif_device_attach(netdev); +- return 0; ++ if (!err) ++ netif_device_attach(netdev); ++ rtnl_unlock(); ++ ++ return err; + } + + static int igb_runtime_idle(struct device *dev) diff --git a/queue-4.9/igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch b/queue-4.9/igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch new file mode 100644 index 00000000000..e8a3dafcd89 --- /dev/null +++ b/queue-4.9/igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch @@ -0,0 +1,37 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Hannu Lounento +Date: Mon, 2 Jan 2017 18:26:06 +0100 +Subject: igb: Fix hw_dbg logging in igb_update_flash_i210 + +From: Hannu Lounento + + +[ Upstream commit 76ed5a8f47476e4984cc8c0c1bc4cee62650f7fd ] + +Fix an if statement with hw_dbg lines where the logic was inverted with +regards to the corresponding return value used in the if statement. + +Signed-off-by: Hannu Lounento +Signed-off-by: Peter Senna Tschudin +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/igb/e1000_i210.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/igb/e1000_i210.c ++++ b/drivers/net/ethernet/intel/igb/e1000_i210.c +@@ -699,9 +699,9 @@ static s32 igb_update_flash_i210(struct + + ret_val = igb_pool_flash_update_done_i210(hw); + if (ret_val) +- hw_dbg("Flash update complete\n"); +- else + hw_dbg("Flash update time out\n"); ++ else ++ hw_dbg("Flash update complete\n"); + + out: + return ret_val; diff --git a/queue-4.9/igb-reset-the-phy-before-reading-the-phy-id.patch b/queue-4.9/igb-reset-the-phy-before-reading-the-phy-id.patch new file mode 100644 index 00000000000..a9a3519ac81 --- /dev/null +++ b/queue-4.9/igb-reset-the-phy-before-reading-the-phy-id.patch @@ -0,0 +1,72 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Aaron Sierra +Date: Tue, 29 Nov 2016 10:03:56 -0600 +Subject: igb: reset the PHY before reading the PHY ID + +From: Aaron Sierra + + +[ Upstream commit 182785335447957409282ca745aa5bc3968facee ] + +Several people have reported firmware leaving the I210/I211 PHY's page +select register set to something other than the default of zero. This +causes the first accesses, PHY_IDx register reads, to access something +else, resulting in device probe failure: + + igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k + igb: Copyright (c) 2007-2014 Intel Corporation. + igb: probe of 0000:01:00.0 failed with error -2 + +This problem began for them after a previous patch I submitted was +applied: + + commit 2a3cdead8b408351fa1e3079b220fa331480ffbc + Author: Aaron Sierra + Date: Tue Nov 3 12:37:09 2015 -0600 + + igb: Remove GS40G specific defines/functions + +I personally experienced this problem after attempting to PXE boot from +I210 devices using this firmware: + + Intel(R) Boot Agent GE v1.5.78 + Copyright (C) 1997-2014, Intel Corporation + +Resetting the PHY before reading from it, ensures the page select +register is in its default state and doesn't make assumptions about +the PHY's register set before the PHY has been probed. + +Cc: Matwey V. Kornilov +Cc: Chris Arges +Cc: Jochen Henneberg +Signed-off-by: Aaron Sierra +Tested-by: Matwey V. Kornilov +Tested-by: Chris J Arges +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/igb/e1000_82575.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/net/ethernet/intel/igb/e1000_82575.c ++++ b/drivers/net/ethernet/intel/igb/e1000_82575.c +@@ -245,6 +245,17 @@ static s32 igb_init_phy_params_82575(str + hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >> + E1000_STATUS_FUNC_SHIFT; + ++ /* Make sure the PHY is in a good state. Several people have reported ++ * firmware leaving the PHY's page select register set to something ++ * other than the default of zero, which causes the PHY ID read to ++ * access something other than the intended register. ++ */ ++ ret_val = hw->phy.ops.reset(hw); ++ if (ret_val) { ++ hw_dbg("Error resetting the PHY.\n"); ++ goto out; ++ } ++ + /* Set phy->phy_addr and phy->id. */ + igb_write_phy_reg_82580(hw, I347AT4_PAGE_SELECT, 0); + ret_val = igb_get_phy_id_82575(hw); diff --git a/queue-4.9/ixgbe-add-mask-for-64-rss-queues.patch b/queue-4.9/ixgbe-add-mask-for-64-rss-queues.patch new file mode 100644 index 00000000000..13b77ba2702 --- /dev/null +++ b/queue-4.9/ixgbe-add-mask-for-64-rss-queues.patch @@ -0,0 +1,55 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Emil Tantilov +Date: Fri, 4 Nov 2016 14:03:03 -0700 +Subject: ixgbe: add mask for 64 RSS queues + +From: Emil Tantilov + + +[ Upstream commit 2bf1a87b903bd81b1448a1cef73de59fb6c4d340 ] + +The indirection table was reported incorrectly for X550 and newer +where we can support up to 64 RSS queues. + +Reported-by Krishneil Singh +Signed-off-by: Emil Tantilov +Tested-by: Andrew Bowers +Signed-off-by: Jeff Kirsher + +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +@@ -308,6 +308,7 @@ static void ixgbe_cache_ring_register(st + ixgbe_cache_ring_rss(adapter); + } + ++#define IXGBE_RSS_64Q_MASK 0x3F + #define IXGBE_RSS_16Q_MASK 0xF + #define IXGBE_RSS_8Q_MASK 0x7 + #define IXGBE_RSS_4Q_MASK 0x3 +@@ -604,6 +605,7 @@ static bool ixgbe_set_sriov_queues(struc + **/ + static bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter) + { ++ struct ixgbe_hw *hw = &adapter->hw; + struct ixgbe_ring_feature *f; + u16 rss_i; + +@@ -612,7 +614,11 @@ static bool ixgbe_set_rss_queues(struct + rss_i = f->limit; + + f->indices = rss_i; +- f->mask = IXGBE_RSS_16Q_MASK; ++ ++ if (hw->mac.type < ixgbe_mac_X550) ++ f->mask = IXGBE_RSS_16Q_MASK; ++ else ++ f->mask = IXGBE_RSS_64Q_MASK; + + /* disable ATR by default, it will be configured below */ + adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; diff --git a/queue-4.9/ixgbe-configure-advertised-speeds-correctly-for-kr-kx-backplane.patch b/queue-4.9/ixgbe-configure-advertised-speeds-correctly-for-kr-kx-backplane.patch new file mode 100644 index 00000000000..e99bb0ed0ae --- /dev/null +++ b/queue-4.9/ixgbe-configure-advertised-speeds-correctly-for-kr-kx-backplane.patch @@ -0,0 +1,39 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Don Skidmore +Date: Tue, 13 Dec 2016 20:34:51 -0500 +Subject: ixgbe: Configure advertised speeds correctly for KR/KX backplane + +From: Don Skidmore + + +[ Upstream commit 54f6d4c42451dbd2cc7e0f0bd8fc3eddcab511fe ] + +This patch ensures that the advertised link speeds are configured +for X553 KR/KX backplane. Without this patch the link remains at +1G when resuming from low power after being downshifted by LPLU. + +Signed-off-by: Don Skidmore +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +@@ -1995,12 +1995,11 @@ static s32 ixgbe_setup_kx4_x550em(struct + /** + * ixgbe_setup_kr_x550em - Configure the KR PHY + * @hw: pointer to hardware structure +- * +- * Configures the integrated KR PHY for X550EM_x. + **/ + static s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw) + { +- if (hw->mac.type != ixgbe_mac_X550EM_x) ++ /* leave link alone for 2.5G */ ++ if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) + return 0; + + return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised); diff --git a/queue-4.9/ixgbe-do-not-disable-fec-from-the-driver.patch b/queue-4.9/ixgbe-do-not-disable-fec-from-the-driver.patch new file mode 100644 index 00000000000..bca4388bd10 --- /dev/null +++ b/queue-4.9/ixgbe-do-not-disable-fec-from-the-driver.patch @@ -0,0 +1,33 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Emil Tantilov +Date: Wed, 28 Sep 2016 16:01:48 -0700 +Subject: ixgbe: do not disable FEC from the driver + +From: Emil Tantilov + + +[ Upstream commit 1fe954b2097bb907b4578e6a74e4c1d23785a601 ] + +FEC is configured by the NVM and the driver should not be +overriding it. + +Signed-off-by: Emil Tantilov +Tested-by: Krishneil Singh +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +@@ -1932,8 +1932,6 @@ static s32 ixgbe_setup_kr_speed_x550em(s + return status; + + reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_ENABLE; +- reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_FEC_REQ | +- IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC); + reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KR | + IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KX); + diff --git a/queue-4.9/ixgbe-fix-aer-error-handling.patch b/queue-4.9/ixgbe-fix-aer-error-handling.patch new file mode 100644 index 00000000000..ecd4dbbeb4a --- /dev/null +++ b/queue-4.9/ixgbe-fix-aer-error-handling.patch @@ -0,0 +1,52 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Emil Tantilov +Date: Wed, 16 Nov 2016 09:48:02 -0800 +Subject: ixgbe: fix AER error handling + +From: Emil Tantilov + + +[ Upstream commit 126db13fa0e6d05c9f94e0125f61e773bd5ab079 ] + +Make sure that we free the IRQs in ixgbe_io_error_detected() when +responding to an PCIe AER error and also restore them when the +interface recovers from it. + +Previously it was possible to trigger BUG_ON() check in free_msix_irqs() +in the case where we call ixgbe_remove() after a failed recovery from +AER error because the interrupts were not freed. + +Signed-off-by: Emil Tantilov +Tested-by: Andrew Bowers +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +@@ -10027,7 +10027,7 @@ skip_bad_vf_detection: + } + + if (netif_running(netdev)) +- ixgbe_down(adapter); ++ ixgbe_close_suspend(adapter); + + if (!test_and_set_bit(__IXGBE_DISABLED, &adapter->state)) + pci_disable_device(pdev); +@@ -10097,10 +10097,12 @@ static void ixgbe_io_resume(struct pci_d + } + + #endif ++ rtnl_lock(); + if (netif_running(netdev)) +- ixgbe_up(adapter); ++ ixgbe_open(netdev); + + netif_device_attach(netdev); ++ rtnl_unlock(); + } + + static const struct pci_error_handlers ixgbe_err_handler = { diff --git a/queue-4.9/ixgbe-fix-reporting-of-100mb-capability.patch b/queue-4.9/ixgbe-fix-reporting-of-100mb-capability.patch new file mode 100644 index 00000000000..1e2c4b57cb3 --- /dev/null +++ b/queue-4.9/ixgbe-fix-reporting-of-100mb-capability.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Tony Nguyen +Date: Thu, 10 Nov 2016 16:00:33 -0800 +Subject: ixgbe: Fix reporting of 100Mb capability + +From: Tony Nguyen + + +[ Upstream commit f215266470dfe86196a31fe0725a86cea77f9a18 ] + +BaseT adapters that are capable of supporting 100Mb are not reporting this +capability. This patch corrects the reporting so that 100Mb is shown as +supported on those adapters. + +Signed-off-by: Tony Nguyen +Tested-by: Andrew Bowers +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +@@ -199,7 +199,7 @@ static int ixgbe_get_settings(struct net + if (supported_link & IXGBE_LINK_SPEED_100_FULL) + ecmd->supported |= ixgbe_isbackplane(hw->phy.media_type) ? + SUPPORTED_1000baseKX_Full : +- SUPPORTED_1000baseT_Full; ++ SUPPORTED_100baseT_Full; + + /* default advertised speed if phy.autoneg_advertised isn't set */ + ecmd->advertising = ecmd->supported; diff --git a/queue-4.9/ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch b/queue-4.9/ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch new file mode 100644 index 00000000000..82abb71b342 --- /dev/null +++ b/queue-4.9/ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch @@ -0,0 +1,78 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Emil Tantilov +Date: Fri, 11 Nov 2016 10:07:47 -0800 +Subject: ixgbe: handle close/suspend race with netif_device_detach/present + +From: Emil Tantilov + + +[ Upstream commit f7f37e7ff2b9b7eff7fbd035569cab35896869a3 ] + +When an interface is part of a namespace it is possible that +ixgbe_close() may be called while __ixgbe_shutdown() is running +which ends up in a double free WARN and/or a BUG in free_msi_irqs(). + +To handle this situation we extend the rtnl_lock() to protect the +call to netif_device_detach() and ixgbe_clear_interrupt_scheme() +in __ixgbe_shutdown() and check for netif_device_present() +to avoid clearing the interrupts second time in ixgbe_close(); + +Also extend the rtnl lock in ixgbe_resume() to netif_device_attach(). + +Signed-off-by: Emil Tantilov +Tested-by: Andrew Bowers +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +@@ -6194,7 +6194,8 @@ int ixgbe_close(struct net_device *netde + + ixgbe_ptp_stop(adapter); + +- ixgbe_close_suspend(adapter); ++ if (netif_device_present(netdev)) ++ ixgbe_close_suspend(adapter); + + ixgbe_fdir_filter_exit(adapter); + +@@ -6239,14 +6240,12 @@ static int ixgbe_resume(struct pci_dev * + if (!err && netif_running(netdev)) + err = ixgbe_open(netdev); + +- rtnl_unlock(); + +- if (err) +- return err; +- +- netif_device_attach(netdev); ++ if (!err) ++ netif_device_attach(netdev); ++ rtnl_unlock(); + +- return 0; ++ return err; + } + #endif /* CONFIG_PM */ + +@@ -6261,14 +6260,14 @@ static int __ixgbe_shutdown(struct pci_d + int retval = 0; + #endif + ++ rtnl_lock(); + netif_device_detach(netdev); + +- rtnl_lock(); + if (netif_running(netdev)) + ixgbe_close_suspend(adapter); +- rtnl_unlock(); + + ixgbe_clear_interrupt_scheme(adapter); ++ rtnl_unlock(); + + #ifdef CONFIG_PM + retval = pci_save_state(pdev); diff --git a/queue-4.9/ixgbe-reduce-i2c-retry-count-on-x550-devices.patch b/queue-4.9/ixgbe-reduce-i2c-retry-count-on-x550-devices.patch new file mode 100644 index 00000000000..18dcc354d66 --- /dev/null +++ b/queue-4.9/ixgbe-reduce-i2c-retry-count-on-x550-devices.patch @@ -0,0 +1,44 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Tony Nguyen +Date: Thu, 10 Nov 2016 09:57:29 -0800 +Subject: ixgbe: Reduce I2C retry count on X550 devices + +From: Tony Nguyen + + +[ Upstream commit 3f0d646b720d541309b11e190db58086f446f41e ] + +A retry count of 10 is likely to run into problems on X550 devices that +have to detect and reset unresponsive CS4227 devices. So, reduce the I2C +retry count to 3 for X550 and above. This should avoid any possible +regressions in existing devices. + +Signed-off-by: Tony Nguyen +Tested-by: Andrew Bowers +Signed-off-by: Jeff Kirsher +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +@@ -113,7 +113,7 @@ static s32 ixgbe_read_i2c_combined_gener + u16 reg, u16 *val, bool lock) + { + u32 swfw_mask = hw->phy.phy_semaphore_mask; +- int max_retry = 10; ++ int max_retry = 3; + int retry = 0; + u8 csum_byte; + u8 high_bits; +@@ -1764,6 +1764,8 @@ static s32 ixgbe_read_i2c_byte_generic_i + u32 swfw_mask = hw->phy.phy_semaphore_mask; + bool nack = true; + ++ if (hw->mac.type >= ixgbe_mac_X550) ++ max_retry = 3; + if (ixgbe_is_sfp_probe(hw, byte_offset, dev_addr)) + max_retry = IXGBE_SFP_DETECT_RETRIES; + diff --git a/queue-4.9/mips-end-asm-function-prologue-macros-with-.insn.patch b/queue-4.9/mips-end-asm-function-prologue-macros-with-.insn.patch new file mode 100644 index 00000000000..8d3492a5434 --- /dev/null +++ b/queue-4.9/mips-end-asm-function-prologue-macros-with-.insn.patch @@ -0,0 +1,76 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Paul Burton +Date: Mon, 7 Nov 2016 11:14:09 +0000 +Subject: MIPS: End asm function prologue macros with .insn + +From: Paul Burton + + +[ Upstream commit 08889582b8aa0bbc01a1e5a0033b9f98d2e11caa ] + +When building a kernel targeting a microMIPS ISA, recent GNU linkers +will fail the link if they cannot determine that the target of a branch +or jump is microMIPS code, with errors such as the following: + + mips-img-linux-gnu-ld: arch/mips/built-in.o: .text+0x542c: + Unsupported jump between ISA modes; consider recompiling with + interlinking enabled. + mips-img-linux-gnu-ld: final link failed: Bad value + +or: + + ./arch/mips/include/asm/uaccess.h:1017: warning: JALX to a + non-word-aligned address + +Placing anything other than an instruction at the start of a function +written in assembly appears to trigger such errors. In order to prepare +for allowing us to follow function prologue macros with an EXPORT_SYMBOL +invocation, end the prologue macros (LEAD, NESTED & FEXPORT) with a +.insn directive. This ensures that the start of the function is marked +as code, which always makes sense for functions & safely prevents us +from hitting the link errors described above. + +Signed-off-by: Paul Burton +Reviewed-by: Maciej W. Rozycki +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/14508/ +Signed-off-by: Ralf Baechle +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/include/asm/asm.h | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/arch/mips/include/asm/asm.h ++++ b/arch/mips/include/asm/asm.h +@@ -54,7 +54,8 @@ + .align 2; \ + .type symbol, @function; \ + .ent symbol, 0; \ +-symbol: .frame sp, 0, ra ++symbol: .frame sp, 0, ra; \ ++ .insn + + /* + * NESTED - declare nested routine entry point +@@ -63,8 +64,9 @@ symbol: .frame sp, 0, ra + .globl symbol; \ + .align 2; \ + .type symbol, @function; \ +- .ent symbol, 0; \ +-symbol: .frame sp, framesize, rpc ++ .ent symbol, 0; \ ++symbol: .frame sp, framesize, rpc; \ ++ .insn + + /* + * END - mark end of function +@@ -86,7 +88,7 @@ symbol: + #define FEXPORT(symbol) \ + .globl symbol; \ + .type symbol, @function; \ +-symbol: ++symbol: .insn + + /* + * ABS - export absolute symbol diff --git a/queue-4.9/mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch b/queue-4.9/mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch new file mode 100644 index 00000000000..58895c892c7 --- /dev/null +++ b/queue-4.9/mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch @@ -0,0 +1,131 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Marcin Nowakowski +Date: Wed, 23 Nov 2016 14:43:45 +0100 +Subject: MIPS: init: Ensure bootmem does not corrupt reserved memory + +From: Marcin Nowakowski + + +[ Upstream commit d9b5b658210f28ed9f70c757d553e679d76e2986 ] + +Current init code initialises bootmem allocator with all of the low +memory that it assumes is available, but does not check for reserved +memory block, which can lead to corruption of data that may be stored +there. +Move bootmem's allocation map to a location that does not cross any +reserved regions + +Signed-off-by: Marcin Nowakowski +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/14609/ +Signed-off-by: Ralf Baechle +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/kernel/setup.c | 74 +++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 71 insertions(+), 3 deletions(-) + +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -153,6 +153,35 @@ void __init detect_memory_region(phys_ad + add_memory_region(start, size, BOOT_MEM_RAM); + } + ++bool __init memory_region_available(phys_addr_t start, phys_addr_t size) ++{ ++ int i; ++ bool in_ram = false, free = true; ++ ++ for (i = 0; i < boot_mem_map.nr_map; i++) { ++ phys_addr_t start_, end_; ++ ++ start_ = boot_mem_map.map[i].addr; ++ end_ = boot_mem_map.map[i].addr + boot_mem_map.map[i].size; ++ ++ switch (boot_mem_map.map[i].type) { ++ case BOOT_MEM_RAM: ++ if (start >= start_ && start + size <= end_) ++ in_ram = true; ++ break; ++ case BOOT_MEM_RESERVED: ++ if ((start >= start_ && start < end_) || ++ (start < start_ && start + size >= start_)) ++ free = false; ++ break; ++ default: ++ continue; ++ } ++ } ++ ++ return in_ram && free; ++} ++ + static void __init print_memory_map(void) + { + int i; +@@ -332,11 +361,19 @@ static void __init bootmem_init(void) + + #else /* !CONFIG_SGI_IP27 */ + ++static unsigned long __init bootmap_bytes(unsigned long pages) ++{ ++ unsigned long bytes = DIV_ROUND_UP(pages, 8); ++ ++ return ALIGN(bytes, sizeof(long)); ++} ++ + static void __init bootmem_init(void) + { + unsigned long reserved_end; + unsigned long mapstart = ~0UL; + unsigned long bootmap_size; ++ bool bootmap_valid = false; + int i; + + /* +@@ -430,11 +467,42 @@ static void __init bootmem_init(void) + #endif + + /* +- * Initialize the boot-time allocator with low memory only. ++ * check that mapstart doesn't overlap with any of ++ * memory regions that have been reserved through eg. DTB + */ +- bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart, +- min_low_pfn, max_low_pfn); ++ bootmap_size = bootmap_bytes(max_low_pfn - min_low_pfn); ++ ++ bootmap_valid = memory_region_available(PFN_PHYS(mapstart), ++ bootmap_size); ++ for (i = 0; i < boot_mem_map.nr_map && !bootmap_valid; i++) { ++ unsigned long mapstart_addr; ++ ++ switch (boot_mem_map.map[i].type) { ++ case BOOT_MEM_RESERVED: ++ mapstart_addr = PFN_ALIGN(boot_mem_map.map[i].addr + ++ boot_mem_map.map[i].size); ++ if (PHYS_PFN(mapstart_addr) < mapstart) ++ break; ++ ++ bootmap_valid = memory_region_available(mapstart_addr, ++ bootmap_size); ++ if (bootmap_valid) ++ mapstart = PHYS_PFN(mapstart_addr); ++ break; ++ default: ++ break; ++ } ++ } + ++ if (!bootmap_valid) ++ panic("No memory area to place a bootmap bitmap"); ++ ++ /* ++ * Initialize the boot-time allocator with low memory only. ++ */ ++ if (bootmap_size != init_bootmem_node(NODE_DATA(0), mapstart, ++ min_low_pfn, max_low_pfn)) ++ panic("Unexpected memory size required for bootmap"); + + for (i = 0; i < boot_mem_map.nr_map; i++) { + unsigned long start, end; diff --git a/queue-4.9/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch b/queue-4.9/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch new file mode 100644 index 00000000000..81e4a8699eb --- /dev/null +++ b/queue-4.9/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch @@ -0,0 +1,41 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Marcin Nowakowski +Date: Wed, 23 Nov 2016 14:43:44 +0100 +Subject: MIPS: init: Ensure reserved memory regions are not added to bootmem + +From: Marcin Nowakowski + + +[ Upstream commit e89ef66d7682f031f026eee6bba03c8c2248d2a9 ] + +Memories managed through boot_mem_map are generally expected to define +non-crossing areas. However, if part of a larger memory block is marked +as reserved, it would still be added to bootmem allocator as an +available block and could end up being overwritten by the allocator. + +Prevent this by explicitly marking the memory as reserved it if exists +in the range used by bootmem allocator. + +Signed-off-by: Marcin Nowakowski +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/14608/ +Signed-off-by: Ralf Baechle +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/kernel/setup.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -551,6 +551,10 @@ static void __init bootmem_init(void) + continue; + default: + /* Not usable memory */ ++ if (start > min_low_pfn && end < max_low_pfn) ++ reserve_bootmem(boot_mem_map.map[i].addr, ++ boot_mem_map.map[i].size, ++ BOOTMEM_DEFAULT); + continue; + } + diff --git a/queue-4.9/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch b/queue-4.9/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch new file mode 100644 index 00000000000..8f6fb9b5de2 --- /dev/null +++ b/queue-4.9/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch @@ -0,0 +1,63 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Paul Burton +Date: Mon, 7 Nov 2016 11:30:41 +0000 +Subject: MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds + +From: Paul Burton + + +[ Upstream commit 9799270affc53414da96e77e454a5616b39cdab0 ] + +Code in arch/mips/netlogic/common/irq.c which handles the XLP PIC fails +to build in XLR configurations due to cpu_is_xlp9xx not being defined, +leading to the following build failure: + + arch/mips/netlogic/common/irq.c: In function ‘xlp_of_pic_init’: + arch/mips/netlogic/common/irq.c:298:2: error: implicit declaration + of function ‘cpu_is_xlp9xx’ [-Werror=implicit-function-declaration] + if (cpu_is_xlp9xx()) { + ^ + +Although the code was conditional upon CONFIG_OF which is indirectly +selected by CONFIG_NLM_XLP_BOARD but not CONFIG_NLM_XLR_BOARD, the +failing XLR with CONFIG_OF configuration can be configured manually or +by randconfig. + +Fix the build failure by making the affected XLP PIC code conditional +upon CONFIG_CPU_XLP which is used to guard the inclusion of +asm/netlogic/xlp-hal/xlp.h that provides the required cpu_is_xlp9xx +function. + +[ralf@linux-mips.org: Fixed up as per Jayachandran's suggestion.] + +Signed-off-by: Paul Burton +Cc: Jayachandran C +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/14524/ +Signed-off-by: Ralf Baechle +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/netlogic/common/irq.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/netlogic/common/irq.c ++++ b/arch/mips/netlogic/common/irq.c +@@ -275,7 +275,7 @@ asmlinkage void plat_irq_dispatch(void) + do_IRQ(nlm_irq_to_xirq(node, i)); + } + +-#ifdef CONFIG_OF ++#ifdef CONFIG_CPU_XLP + static const struct irq_domain_ops xlp_pic_irq_domain_ops = { + .xlate = irq_domain_xlate_onetwocell, + }; +@@ -348,7 +348,7 @@ void __init arch_init_irq(void) + #if defined(CONFIG_CPU_XLR) + nlm_setup_fmn_irq(); + #endif +-#if defined(CONFIG_OF) ++#ifdef CONFIG_CPU_XLP + of_irq_init(xlp_pic_irq_ids); + #endif + } diff --git a/queue-4.9/mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch b/queue-4.9/mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch new file mode 100644 index 00000000000..d41bef68b7f --- /dev/null +++ b/queue-4.9/mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch @@ -0,0 +1,140 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Paul Burton +Date: Mon, 17 Oct 2016 16:01:07 +0100 +Subject: MIPS: traps: Ensure L1 & L2 ECC checking match for CM3 systems + +From: Paul Burton + + +[ Upstream commit 35e6de38858f59b6b65dcfeaf700b5d06fc2b93d ] + +On systems with CM3, we must ensure that the L1 & L2 ECC enables are set +to the same value. This is presumed by the hardware & cache corruption +can occur when it is not the case. Support enabling & disabling the L2 +ECC checking on CM3 systems where this is controlled via a GCR, and +ensure that it matches the state of L1 ECC checking. Remove I6400 from +the switch statement it will no longer hit, and which was incorrect +since the L2 ECC enable bit isn't in the CP0 ErrCtl register. + +Signed-off-by: Paul Burton +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/14413/ +Signed-off-by: Ralf Baechle +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/include/asm/mips-cm.h | 7 ++++ + arch/mips/kernel/traps.c | 63 ++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 67 insertions(+), 3 deletions(-) + +--- a/arch/mips/include/asm/mips-cm.h ++++ b/arch/mips/include/asm/mips-cm.h +@@ -187,6 +187,7 @@ BUILD_CM_R_(config, MIPS_CM_GCB_OFS + 0 + BUILD_CM_RW(base, MIPS_CM_GCB_OFS + 0x08) + BUILD_CM_RW(access, MIPS_CM_GCB_OFS + 0x20) + BUILD_CM_R_(rev, MIPS_CM_GCB_OFS + 0x30) ++BUILD_CM_RW(err_control, MIPS_CM_GCB_OFS + 0x38) + BUILD_CM_RW(error_mask, MIPS_CM_GCB_OFS + 0x40) + BUILD_CM_RW(error_cause, MIPS_CM_GCB_OFS + 0x48) + BUILD_CM_RW(error_addr, MIPS_CM_GCB_OFS + 0x50) +@@ -266,6 +267,12 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80) + #define CM_REV_CM2_5 CM_ENCODE_REV(7, 0) + #define CM_REV_CM3 CM_ENCODE_REV(8, 0) + ++/* GCR_ERR_CONTROL register fields */ ++#define CM_GCR_ERR_CONTROL_L2_ECC_EN_SHF 1 ++#define CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK (_ULCAST_(0x1) << 1) ++#define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_SHF 0 ++#define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK (_ULCAST_(0x1) << 0) ++ + /* GCR_ERROR_CAUSE register fields */ + #define CM_GCR_ERROR_CAUSE_ERRTYPE_SHF 27 + #define CM_GCR_ERROR_CAUSE_ERRTYPE_MSK (_ULCAST_(0x1f) << 27) +--- a/arch/mips/kernel/traps.c ++++ b/arch/mips/kernel/traps.c +@@ -51,6 +51,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1646,6 +1647,65 @@ __setup("nol2par", nol2parity); + */ + static inline void parity_protection_init(void) + { ++#define ERRCTL_PE 0x80000000 ++#define ERRCTL_L2P 0x00800000 ++ ++ if (mips_cm_revision() >= CM_REV_CM3) { ++ ulong gcr_ectl, cp0_ectl; ++ ++ /* ++ * With CM3 systems we need to ensure that the L1 & L2 ++ * parity enables are set to the same value, since this ++ * is presumed by the hardware engineers. ++ * ++ * If the user disabled either of L1 or L2 ECC checking, ++ * disable both. ++ */ ++ l1parity &= l2parity; ++ l2parity &= l1parity; ++ ++ /* Probe L1 ECC support */ ++ cp0_ectl = read_c0_ecc(); ++ write_c0_ecc(cp0_ectl | ERRCTL_PE); ++ back_to_back_c0_hazard(); ++ cp0_ectl = read_c0_ecc(); ++ ++ /* Probe L2 ECC support */ ++ gcr_ectl = read_gcr_err_control(); ++ ++ if (!(gcr_ectl & CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK) || ++ !(cp0_ectl & ERRCTL_PE)) { ++ /* ++ * One of L1 or L2 ECC checking isn't supported, ++ * so we cannot enable either. ++ */ ++ l1parity = l2parity = 0; ++ } ++ ++ /* Configure L1 ECC checking */ ++ if (l1parity) ++ cp0_ectl |= ERRCTL_PE; ++ else ++ cp0_ectl &= ~ERRCTL_PE; ++ write_c0_ecc(cp0_ectl); ++ back_to_back_c0_hazard(); ++ WARN_ON(!!(read_c0_ecc() & ERRCTL_PE) != l1parity); ++ ++ /* Configure L2 ECC checking */ ++ if (l2parity) ++ gcr_ectl |= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK; ++ else ++ gcr_ectl &= ~CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK; ++ write_gcr_err_control(gcr_ectl); ++ gcr_ectl = read_gcr_err_control(); ++ gcr_ectl &= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK; ++ WARN_ON(!!gcr_ectl != l2parity); ++ ++ pr_info("Cache parity protection %sabled\n", ++ l1parity ? "en" : "dis"); ++ return; ++ } ++ + switch (current_cpu_type()) { + case CPU_24K: + case CPU_34K: +@@ -1656,11 +1716,8 @@ static inline void parity_protection_ini + case CPU_PROAPTIV: + case CPU_P5600: + case CPU_QEMU_GENERIC: +- case CPU_I6400: + case CPU_P6600: + { +-#define ERRCTL_PE 0x80000000 +-#define ERRCTL_L2P 0x00800000 + unsigned long errctl; + unsigned int l1parity_present, l2parity_present; + diff --git a/queue-4.9/power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch b/queue-4.9/power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch new file mode 100644 index 00000000000..bef0143609c --- /dev/null +++ b/queue-4.9/power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch @@ -0,0 +1,89 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Hans de Goede +Date: Wed, 14 Dec 2016 17:38:52 +0100 +Subject: power: supply: axp288_fuel_gauge: Read 12 bit values 2 registers at a time + +From: Hans de Goede + + +[ Upstream commit 248efcf00602f0282587999bcc221a872bd72530 ] + +In order for the MSB -> LSB latching to work correctly we must read the +2 8 bit registers of a 12 bit value in one consecutive read. + +This fixes voltage_ocv reporting inconsistent values on my tablet. + +Signed-off-by: Hans de Goede +Signed-off-by: Sebastian Reichel +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/power/supply/axp288_fuel_gauge.c | 40 +++++++++++++++++-------------- + 1 file changed, 22 insertions(+), 18 deletions(-) + +--- a/drivers/power/supply/axp288_fuel_gauge.c ++++ b/drivers/power/supply/axp288_fuel_gauge.c +@@ -210,6 +210,22 @@ static int fuel_gauge_read_15bit_word(st + return ret & FG_15BIT_VAL_MASK; + } + ++static int fuel_gauge_read_12bit_word(struct axp288_fg_info *info, int reg) ++{ ++ unsigned char buf[2]; ++ int ret; ++ ++ ret = regmap_bulk_read(info->regmap, reg, buf, 2); ++ if (ret < 0) { ++ dev_err(&info->pdev->dev, "Error reading reg 0x%02x err: %d\n", ++ reg, ret); ++ return ret; ++ } ++ ++ /* 12-bit data values have upper 8 bits in buf[0], lower 4 in buf[1] */ ++ return (buf[0] << 4) | ((buf[1] >> 4) & 0x0f); ++} ++ + static int pmic_read_adc_val(const char *name, int *raw_val, + struct axp288_fg_info *info) + { +@@ -270,12 +286,9 @@ static int fuel_gauge_debug_show(struct + seq_printf(s, " FG_RDC0[%02x] : %02x\n", + AXP288_FG_RDC0_REG, + fuel_gauge_reg_readb(info, AXP288_FG_RDC0_REG)); +- seq_printf(s, " FG_OCVH[%02x] : %02x\n", ++ seq_printf(s, " FG_OCV[%02x] : %04x\n", + AXP288_FG_OCVH_REG, +- fuel_gauge_reg_readb(info, AXP288_FG_OCVH_REG)); +- seq_printf(s, " FG_OCVL[%02x] : %02x\n", +- AXP288_FG_OCVL_REG, +- fuel_gauge_reg_readb(info, AXP288_FG_OCVL_REG)); ++ fuel_gauge_read_12bit_word(info, AXP288_FG_OCVH_REG)); + seq_printf(s, " FG_DES_CAP[%02x] : %04x\n", + AXP288_FG_DES_CAP1_REG, + fuel_gauge_read_15bit_word(info, AXP288_FG_DES_CAP1_REG)); +@@ -532,21 +545,12 @@ temp_read_fail: + + static int fuel_gauge_get_vocv(struct axp288_fg_info *info, int *vocv) + { +- int ret, value; +- +- /* 12-bit data value, upper 8 in OCVH, lower 4 in OCVL */ +- ret = fuel_gauge_reg_readb(info, AXP288_FG_OCVH_REG); +- if (ret < 0) +- goto vocv_read_fail; +- value = ret << 4; ++ int ret; + +- ret = fuel_gauge_reg_readb(info, AXP288_FG_OCVL_REG); +- if (ret < 0) +- goto vocv_read_fail; +- value |= (ret & 0xf); ++ ret = fuel_gauge_read_12bit_word(info, AXP288_FG_OCVH_REG); ++ if (ret >= 0) ++ *vocv = VOLTAGE_FROM_ADC(ret); + +- *vocv = VOLTAGE_FROM_ADC(value); +-vocv_read_fail: + return ret; + } + diff --git a/queue-4.9/power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch b/queue-4.9/power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch new file mode 100644 index 00000000000..f60735727b4 --- /dev/null +++ b/queue-4.9/power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch @@ -0,0 +1,140 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Hans de Goede +Date: Wed, 14 Dec 2016 17:38:51 +0100 +Subject: power: supply: axp288_fuel_gauge: Read 15 bit values 2 registers at a time + +From: Hans de Goede + + +[ Upstream commit 4949fc5e071f8e8d8122e0b16cf6a2ec1ca36258 ] + +In order for the MSB -> LSB latching to work correctly we must read the +2 8 bit registers of a 15 bit value in one consecutive read. + +This fixes charge_full reporting 3498768 on some reads and 3354624 one +other reads on my tablet (for the 3354624 value the raw LSB is 0x00). + +Signed-off-by: Hans de Goede +Signed-off-by: Sebastian Reichel +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/power/supply/axp288_fuel_gauge.c | 63 ++++++++++++++++--------------- + 1 file changed, 34 insertions(+), 29 deletions(-) + +--- a/drivers/power/supply/axp288_fuel_gauge.c ++++ b/drivers/power/supply/axp288_fuel_gauge.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + + #define CHRG_STAT_BAT_SAFE_MODE (1 << 3) + #define CHRG_STAT_BAT_VALID (1 << 4) +@@ -73,17 +74,15 @@ + #define FG_CNTL_CC_EN (1 << 6) + #define FG_CNTL_GAUGE_EN (1 << 7) + ++#define FG_15BIT_WORD_VALID (1 << 15) ++#define FG_15BIT_VAL_MASK 0x7fff ++ + #define FG_REP_CAP_VALID (1 << 7) + #define FG_REP_CAP_VAL_MASK 0x7F + + #define FG_DES_CAP1_VALID (1 << 7) +-#define FG_DES_CAP1_VAL_MASK 0x7F +-#define FG_DES_CAP0_VAL_MASK 0xFF + #define FG_DES_CAP_RES_LSB 1456 /* 1.456mAhr */ + +-#define FG_CC_MTR1_VALID (1 << 7) +-#define FG_CC_MTR1_VAL_MASK 0x7F +-#define FG_CC_MTR0_VAL_MASK 0xFF + #define FG_DES_CC_RES_LSB 1456 /* 1.456mAhr */ + + #define FG_OCV_CAP_VALID (1 << 7) +@@ -189,6 +188,28 @@ static int fuel_gauge_reg_writeb(struct + return ret; + } + ++static int fuel_gauge_read_15bit_word(struct axp288_fg_info *info, int reg) ++{ ++ unsigned char buf[2]; ++ int ret; ++ ++ ret = regmap_bulk_read(info->regmap, reg, buf, 2); ++ if (ret < 0) { ++ dev_err(&info->pdev->dev, "Error reading reg 0x%02x err: %d\n", ++ reg, ret); ++ return ret; ++ } ++ ++ ret = get_unaligned_be16(buf); ++ if (!(ret & FG_15BIT_WORD_VALID)) { ++ dev_err(&info->pdev->dev, "Error reg 0x%02x contents not valid\n", ++ reg); ++ return -ENXIO; ++ } ++ ++ return ret & FG_15BIT_VAL_MASK; ++} ++ + static int pmic_read_adc_val(const char *name, int *raw_val, + struct axp288_fg_info *info) + { +@@ -255,18 +276,12 @@ static int fuel_gauge_debug_show(struct + seq_printf(s, " FG_OCVL[%02x] : %02x\n", + AXP288_FG_OCVL_REG, + fuel_gauge_reg_readb(info, AXP288_FG_OCVL_REG)); +- seq_printf(s, "FG_DES_CAP1[%02x] : %02x\n", ++ seq_printf(s, " FG_DES_CAP[%02x] : %04x\n", + AXP288_FG_DES_CAP1_REG, +- fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP1_REG)); +- seq_printf(s, "FG_DES_CAP0[%02x] : %02x\n", +- AXP288_FG_DES_CAP0_REG, +- fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP0_REG)); +- seq_printf(s, " FG_CC_MTR1[%02x] : %02x\n", ++ fuel_gauge_read_15bit_word(info, AXP288_FG_DES_CAP1_REG)); ++ seq_printf(s, " FG_CC_MTR[%02x] : %04x\n", + AXP288_FG_CC_MTR1_REG, +- fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR1_REG)); +- seq_printf(s, " FG_CC_MTR0[%02x] : %02x\n", +- AXP288_FG_CC_MTR0_REG, +- fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR0_REG)); ++ fuel_gauge_read_15bit_word(info, AXP288_FG_CC_MTR1_REG)); + seq_printf(s, " FG_OCV_CAP[%02x] : %02x\n", + AXP288_FG_OCV_CAP_REG, + fuel_gauge_reg_readb(info, AXP288_FG_OCV_CAP_REG)); +@@ -663,28 +678,18 @@ static int fuel_gauge_get_property(struc + val->intval = POWER_SUPPLY_TECHNOLOGY_LION; + break; + case POWER_SUPPLY_PROP_CHARGE_NOW: +- ret = fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR1_REG); ++ ret = fuel_gauge_read_15bit_word(info, AXP288_FG_CC_MTR1_REG); + if (ret < 0) + goto fuel_gauge_read_err; + +- value = (ret & FG_CC_MTR1_VAL_MASK) << 8; +- ret = fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR0_REG); +- if (ret < 0) +- goto fuel_gauge_read_err; +- value |= (ret & FG_CC_MTR0_VAL_MASK); +- val->intval = value * FG_DES_CAP_RES_LSB; ++ val->intval = ret * FG_DES_CAP_RES_LSB; + break; + case POWER_SUPPLY_PROP_CHARGE_FULL: +- ret = fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP1_REG); ++ ret = fuel_gauge_read_15bit_word(info, AXP288_FG_DES_CAP1_REG); + if (ret < 0) + goto fuel_gauge_read_err; + +- value = (ret & FG_DES_CAP1_VAL_MASK) << 8; +- ret = fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP0_REG); +- if (ret < 0) +- goto fuel_gauge_read_err; +- value |= (ret & FG_DES_CAP0_VAL_MASK); +- val->intval = value * FG_DES_CAP_RES_LSB; ++ val->intval = ret * FG_DES_CAP_RES_LSB; + break; + case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: + val->intval = PROP_CURR(info->pdata->design_cap); diff --git a/queue-4.9/revert-crypto-xts-add-ecb-dependency.patch b/queue-4.9/revert-crypto-xts-add-ecb-dependency.patch new file mode 100644 index 00000000000..f56b054268b --- /dev/null +++ b/queue-4.9/revert-crypto-xts-add-ecb-dependency.patch @@ -0,0 +1,29 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Sasha Levin +Date: Mon, 13 Nov 2017 17:55:20 -0500 +Subject: Revert "crypto: xts - Add ECB dependency" + +From: Sasha Levin + + +This reverts commit 6145171a6bc0abdc3eca7a4b795ede467d2ba569. + +The commit fixes a bug that was only introduced in 4.10, thus is +irrelevant for <=4.9. + +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + crypto/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -360,7 +360,6 @@ config CRYPTO_XTS + select CRYPTO_BLKCIPHER + select CRYPTO_MANAGER + select CRYPTO_GF128MUL +- select CRYPTO_ECB + help + XTS: IEEE1619/D16 narrow block cipher use with aes-xts-plain, + key size 256, 384 or 512 bits. This implementation currently diff --git a/queue-4.9/revert-dt-bindings-add-lego-mindstorms-ev3-compatible-specification.patch b/queue-4.9/revert-dt-bindings-add-lego-mindstorms-ev3-compatible-specification.patch new file mode 100644 index 00000000000..7aab05892cf --- /dev/null +++ b/queue-4.9/revert-dt-bindings-add-lego-mindstorms-ev3-compatible-specification.patch @@ -0,0 +1,31 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Sasha Levin +Date: Thu, 16 Nov 2017 21:04:58 -0500 +Subject: Revert "dt-bindings: Add LEGO MINDSTORMS EV3 compatible specification" + +From: Sasha Levin + + +This reverts commit 852bf68b7a62195c3c0c63f3b11f3f30958fc220. + +As Ben pointed out, these drivers don't exist in <=4.9. + +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/devicetree/bindings/arm/davinci.txt | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/Documentation/devicetree/bindings/arm/davinci.txt ++++ b/Documentation/devicetree/bindings/arm/davinci.txt +@@ -13,10 +13,6 @@ EnBW AM1808 based CMC board + Required root node properties: + - compatible = "enbw,cmc", "ti,da850; + +-LEGO MINDSTORMS EV3 (AM1808 based) +-Required root node properties: +- - compatible = "lego,ev3", "ti,da850"; +- + Generic DaVinci Boards + ---------------------- + diff --git a/queue-4.9/revert-dt-bindings-add-vendor-prefix-for-lego.patch b/queue-4.9/revert-dt-bindings-add-vendor-prefix-for-lego.patch new file mode 100644 index 00000000000..646286c6738 --- /dev/null +++ b/queue-4.9/revert-dt-bindings-add-vendor-prefix-for-lego.patch @@ -0,0 +1,28 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Sasha Levin +Date: Thu, 16 Nov 2017 21:04:38 -0500 +Subject: Revert "dt-bindings: Add vendor prefix for LEGO" + +From: Sasha Levin + + +This reverts commit 04e13a5ec96db94c1cc8ce7b0b1e1b626e0c00c7. + +As Ben pointed out, these drivers don't exist in <=4.9. + +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/devicetree/bindings/vendor-prefixes.txt | 1 - + 1 file changed, 1 deletion(-) + +--- a/Documentation/devicetree/bindings/vendor-prefixes.txt ++++ b/Documentation/devicetree/bindings/vendor-prefixes.txt +@@ -154,7 +154,6 @@ kosagi Sutajio Ko-Usagi PTE Ltd. + kyo Kyocera Corporation + lacie LaCie + lantiq Lantiq Semiconductor +-lego LEGO Systems A/S + lenovo Lenovo Group Ltd. + lg LG Corporation + linux Linux-specific binding diff --git a/queue-4.9/revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch b/queue-4.9/revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch new file mode 100644 index 00000000000..0f32fb7bb5f --- /dev/null +++ b/queue-4.9/revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch @@ -0,0 +1,41 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Sasha Levin +Date: Mon, 13 Nov 2017 18:03:32 -0500 +Subject: Revert "uapi: fix linux/rds.h userspace compilation errors" + +From: Sasha Levin + + +This reverts commit ad50561ba7a664bc581826c9d57d137fcf17bfa5. + +There was a mixup with the commit message for two upstream commit +that have the same subject line. + +This revert will be followed by the two commits with proper commit +messages. + +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + include/uapi/linux/rds.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/include/uapi/linux/rds.h ++++ b/include/uapi/linux/rds.h +@@ -35,7 +35,6 @@ + #define _LINUX_RDS_H + + #include +-#include /* For __kernel_sockaddr_storage. */ + + #define RDS_IB_ABI_VERSION 0x301 + +@@ -224,7 +223,7 @@ struct rds_get_mr_args { + }; + + struct rds_get_mr_for_dest_args { +- struct __kernel_sockaddr_storage dest_addr; ++ struct sockaddr_storage dest_addr; + struct rds_iovec vec; + uint64_t cookie_addr; + uint64_t flags; diff --git a/queue-4.9/rtc-rx8010-change-lock-mechanism.patch b/queue-4.9/rtc-rx8010-change-lock-mechanism.patch new file mode 100644 index 00000000000..1b032689a71 --- /dev/null +++ b/queue-4.9/rtc-rx8010-change-lock-mechanism.patch @@ -0,0 +1,190 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Fabien Lahoudere +Date: Tue, 20 Dec 2016 09:42:44 +0100 +Subject: rtc: rx8010: change lock mechanism + +From: Fabien Lahoudere + + +[ Upstream commit 666b5d1e9f8762300a410f9548b6e370d71dd382 ] + +Remove spinlock and use the "rtc->ops_lock" from RTC subsystem instead. +spin_lock_irqsave() is not needed here because we do not have hard IRQs. + +This patch fixes the following issue: + +root@GE004097290448 b850v3:~# hwclock --systohc +root@GE004097290448 b850v3:~# hwclock --systohc +root@GE004097290448 b850v3:~# hwclock --systohc +root@GE004097290448 b850v3:~# hwclock --systohc +root@GE004097290448 b850v3:~# hwclock --systohc +[ 82.108175] BUG: spinlock wrong CPU on CPU#0, hwclock/855 +[ 82.113660] lock: 0xedb4899c, .magic: dead4ead, .owner: hwclock/855, .owner_cpu: 1 +[ 82.121329] CPU: 0 PID: 855 Comm: hwclock Not tainted 4.8.0-00042-g09d5410-dirty #20 +[ 82.129078] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) +[ 82.135609] Backtrace: +[ 82.138090] [<8010d378>] (dump_backtrace) from [<8010d5c0>] (show_stack+0x20/0x24) +[ 82.145664] r7:ec936000 r6:600a0013 r5:00000000 r4:81031680 +[ 82.151402] [<8010d5a0>] (show_stack) from [<80401518>] (dump_stack+0xb4/0xe8) +[ 82.158636] [<80401464>] (dump_stack) from [<8017b8b0>] (spin_dump+0x84/0xcc) +[ 82.165775] r10:00000000 r9:ec936000 r8:81056090 r7:600a0013 r6:edb4899c r5:edb4899c +[ 82.173691] r4:e5033e00 r3:00000000 +[ 82.177308] [<8017b82c>] (spin_dump) from [<8017bcb0>] (do_raw_spin_unlock+0x108/0x130) +[ 82.185314] r5:edb4899c r4:edb4899c +[ 82.188938] [<8017bba8>] (do_raw_spin_unlock) from [<8094b93c>] (_raw_spin_unlock_irqrestore+0x34/0x54) +[ 82.198333] r5:edb4899c r4:600a0013 +[ 82.201953] [<8094b908>] (_raw_spin_unlock_irqrestore) from [<8065b090>] (rx8010_set_time+0x14c/0x188) +[ 82.211261] r5:00000020 r4:edb48990 +[ 82.214882] [<8065af44>] (rx8010_set_time) from [<80653fe4>] (rtc_set_time+0x70/0x104) +[ 82.222801] r7:00000051 r6:edb39da0 r5:edb39c00 r4:ec937e8c +[ 82.228535] [<80653f74>] (rtc_set_time) from [<80655774>] (rtc_dev_ioctl+0x3c4/0x674) +[ 82.236368] r7:00000051 r6:7ecf1b74 r5:00000000 r4:edb39c00 +[ 82.242106] [<806553b0>] (rtc_dev_ioctl) from [<80284034>] (do_vfs_ioctl+0xa4/0xa6c) +[ 82.249851] r8:00000003 r7:80284a40 r6:ed1e9c80 r5:edb44e60 r4:7ecf1b74 +[ 82.256642] [<80283f90>] (do_vfs_ioctl) from [<80284a40>] (SyS_ioctl+0x44/0x6c) +[ 82.263953] r10:00000000 r9:ec936000 r8:7ecf1b74 r7:4024700a r6:ed1e9c80 r5:00000003 +[ 82.271869] r4:ed1e9c80 +[ 82.274432] [<802849fc>] (SyS_ioctl) from [<80108520>] (ret_fast_syscall+0x0/0x1c) +[ 82.282005] r9:ec936000 r8:801086c4 r7:00000036 r6:00000000 r5:00000003 r4:0008e1bc +root@GE004097290448 b850v3:~# +Message from syslogd@GE004097290448 at Dec 3 11:17:08 ... + kernel:[ 82.108175] BUG: spinlock wrong CPU on CPU#0, hwclock/855 + +Message from syslogd@GE004097290448 at Dec 3 11:17:08 ... + kernel:[ 82.113660] lock: 0xedb4899c, .magic: dead4ead, .owner: hwclock/855, .owner_cpu: 1 +hwclock --systohc +root@GE004097290448 b850v3:~# + +Signed-off-by: Fabien Lahoudere +Signed-off-by: Alexandre Belloni +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/rtc/rtc-rx8010.c | 24 +++--------------------- + 1 file changed, 3 insertions(+), 21 deletions(-) + +--- a/drivers/rtc/rtc-rx8010.c ++++ b/drivers/rtc/rtc-rx8010.c +@@ -63,7 +63,6 @@ struct rx8010_data { + struct i2c_client *client; + struct rtc_device *rtc; + u8 ctrlreg; +- spinlock_t flags_lock; + }; + + static irqreturn_t rx8010_irq_1_handler(int irq, void *dev_id) +@@ -72,12 +71,12 @@ static irqreturn_t rx8010_irq_1_handler( + struct rx8010_data *rx8010 = i2c_get_clientdata(client); + int flagreg; + +- spin_lock(&rx8010->flags_lock); ++ mutex_lock(&rx8010->rtc->ops_lock); + + flagreg = i2c_smbus_read_byte_data(client, RX8010_FLAG); + + if (flagreg <= 0) { +- spin_unlock(&rx8010->flags_lock); ++ mutex_unlock(&rx8010->rtc->ops_lock); + return IRQ_NONE; + } + +@@ -101,7 +100,7 @@ static irqreturn_t rx8010_irq_1_handler( + + i2c_smbus_write_byte_data(client, RX8010_FLAG, flagreg); + +- spin_unlock(&rx8010->flags_lock); ++ mutex_unlock(&rx8010->rtc->ops_lock); + return IRQ_HANDLED; + } + +@@ -143,7 +142,6 @@ static int rx8010_set_time(struct device + u8 date[7]; + int ctrl, flagreg; + int ret; +- unsigned long irqflags; + + if ((dt->tm_year < 100) || (dt->tm_year > 199)) + return -EINVAL; +@@ -181,11 +179,8 @@ static int rx8010_set_time(struct device + if (ret < 0) + return ret; + +- spin_lock_irqsave(&rx8010->flags_lock, irqflags); +- + flagreg = i2c_smbus_read_byte_data(rx8010->client, RX8010_FLAG); + if (flagreg < 0) { +- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); + return flagreg; + } + +@@ -193,8 +188,6 @@ static int rx8010_set_time(struct device + ret = i2c_smbus_write_byte_data(rx8010->client, RX8010_FLAG, + flagreg & ~RX8010_FLAG_VLF); + +- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); +- + return 0; + } + +@@ -288,12 +281,9 @@ static int rx8010_set_alarm(struct devic + u8 alarmvals[3]; + int extreg, flagreg; + int err; +- unsigned long irqflags; + +- spin_lock_irqsave(&rx8010->flags_lock, irqflags); + flagreg = i2c_smbus_read_byte_data(client, RX8010_FLAG); + if (flagreg < 0) { +- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); + return flagreg; + } + +@@ -302,14 +292,12 @@ static int rx8010_set_alarm(struct devic + err = i2c_smbus_write_byte_data(rx8010->client, RX8010_CTRL, + rx8010->ctrlreg); + if (err < 0) { +- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); + return err; + } + } + + flagreg &= ~RX8010_FLAG_AF; + err = i2c_smbus_write_byte_data(rx8010->client, RX8010_FLAG, flagreg); +- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); + if (err < 0) + return err; + +@@ -404,7 +392,6 @@ static int rx8010_ioctl(struct device *d + struct rx8010_data *rx8010 = dev_get_drvdata(dev); + int ret, tmp; + int flagreg; +- unsigned long irqflags; + + switch (cmd) { + case RTC_VL_READ: +@@ -419,16 +406,13 @@ static int rx8010_ioctl(struct device *d + return 0; + + case RTC_VL_CLR: +- spin_lock_irqsave(&rx8010->flags_lock, irqflags); + flagreg = i2c_smbus_read_byte_data(rx8010->client, RX8010_FLAG); + if (flagreg < 0) { +- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); + return flagreg; + } + + flagreg &= ~RX8010_FLAG_VLF; + ret = i2c_smbus_write_byte_data(client, RX8010_FLAG, flagreg); +- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); + if (ret < 0) + return ret; + +@@ -466,8 +450,6 @@ static int rx8010_probe(struct i2c_clien + rx8010->client = client; + i2c_set_clientdata(client, rx8010); + +- spin_lock_init(&rx8010->flags_lock); +- + err = rx8010_init_client(client); + if (err) + return err; diff --git a/queue-4.9/scsi-lpfc-add-missing-memory-barrier.patch b/queue-4.9/scsi-lpfc-add-missing-memory-barrier.patch new file mode 100644 index 00000000000..5248515096b --- /dev/null +++ b/queue-4.9/scsi-lpfc-add-missing-memory-barrier.patch @@ -0,0 +1,39 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: James Smart +Date: Mon, 19 Dec 2016 15:07:30 -0800 +Subject: scsi: lpfc: Add missing memory barrier + +From: James Smart + + +[ Upstream commit 6b3b3bdb83b4ad51252d21bb13596db879e51850 ] + +On loosely ordered memory systems (PPC for example), the WQE elements +were being updated in memory, but not necessarily flushed before the +separate doorbell was written to hw which would cause hw to dma the +WQE element. Thus, the hardware occasionally received partially +updated WQE data. + +Add the memory barrier after updating the WQE memory. + +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Reviewed-by: Hannes Reinecke +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/lpfc/lpfc_sli.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -119,6 +119,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, u + if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED) + bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id); + lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size); ++ /* ensure WQE bcopy flushed before doorbell write */ ++ wmb(); + + /* Update the host index before invoking device */ + host_index = q->host_index; diff --git a/queue-4.9/scsi-lpfc-clear-the-vendorversion-in-the-plogi-plogi-acc-payload.patch b/queue-4.9/scsi-lpfc-clear-the-vendorversion-in-the-plogi-plogi-acc-payload.patch new file mode 100644 index 00000000000..68d59db91b3 --- /dev/null +++ b/queue-4.9/scsi-lpfc-clear-the-vendorversion-in-the-plogi-plogi-acc-payload.patch @@ -0,0 +1,63 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: James Smart +Date: Mon, 19 Dec 2016 15:07:20 -0800 +Subject: scsi: lpfc: Clear the VendorVersion in the PLOGI/PLOGI ACC payload + +From: James Smart + + +[ Upstream commit e0165f20447c8ca1d367725ee94d8ec9f38ca275 ] + +Clear the VendorVersion in the PLOGI/PLOGI ACC payload + +Vendor version info may have been set on fabric login. Before sending +PLOGI payloads, ensure that it's cleared. + +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Reviewed-by: Hannes Reinecke +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/lpfc/lpfc_els.c | 6 ++++++ + drivers/scsi/lpfc/lpfc_hw.h | 6 ++++++ + 2 files changed, 12 insertions(+) + +--- a/drivers/scsi/lpfc/lpfc_els.c ++++ b/drivers/scsi/lpfc/lpfc_els.c +@@ -1999,6 +1999,9 @@ lpfc_issue_els_plogi(struct lpfc_vport * + if (sp->cmn.fcphHigh < FC_PH3) + sp->cmn.fcphHigh = FC_PH3; + ++ sp->cmn.valid_vendor_ver_level = 0; ++ memset(sp->vendorVersion, 0, sizeof(sp->vendorVersion)); ++ + lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, + "Issue PLOGI: did:x%x", + did, 0, 0); +@@ -3990,6 +3993,9 @@ lpfc_els_rsp_acc(struct lpfc_vport *vpor + } else { + memcpy(pcmd, &vport->fc_sparam, + sizeof(struct serv_parm)); ++ ++ sp->cmn.valid_vendor_ver_level = 0; ++ memset(sp->vendorVersion, 0, sizeof(sp->vendorVersion)); + } + + lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, +--- a/drivers/scsi/lpfc/lpfc_hw.h ++++ b/drivers/scsi/lpfc/lpfc_hw.h +@@ -360,6 +360,12 @@ struct csp { + * Word 1 Bit 30 in PLOGI request is random offset + */ + #define virtual_fabric_support randomOffset /* Word 1, bit 30 */ ++/* ++ * Word 1 Bit 29 in common service parameter is overloaded. ++ * Word 1 Bit 29 in FLOGI response is multiple NPort assignment ++ * Word 1 Bit 29 in FLOGI/PLOGI request is Valid Vendor Version Level ++ */ ++#define valid_vendor_ver_level response_multiple_NPort /* Word 1, bit 29 */ + #ifdef __BIG_ENDIAN_BITFIELD + uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */ + uint16_t randomOffset:1; /* FC Word 1, bit 30 */ diff --git a/queue-4.9/scsi-lpfc-correct-host-name-in-symbolic_name-field.patch b/queue-4.9/scsi-lpfc-correct-host-name-in-symbolic_name-field.patch new file mode 100644 index 00000000000..1368e869514 --- /dev/null +++ b/queue-4.9/scsi-lpfc-correct-host-name-in-symbolic_name-field.patch @@ -0,0 +1,62 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: James Smart +Date: Mon, 19 Dec 2016 15:07:24 -0800 +Subject: scsi: lpfc: Correct host name in symbolic_name field + +From: James Smart + + +[ Upstream commit 6c9231f604c2575be24c96d38deb70f145172f92 ] + +Correct host name in symbolic_name field of nameserver registrations + +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Reviewed-by: Hannes Reinecke +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/lpfc/lpfc_attr.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +--- a/drivers/scsi/lpfc/lpfc_attr.c ++++ b/drivers/scsi/lpfc/lpfc_attr.c +@@ -5131,6 +5131,19 @@ lpfc_free_sysfs_attr(struct lpfc_vport * + */ + + /** ++ * lpfc_get_host_symbolic_name - Copy symbolic name into the scsi host ++ * @shost: kernel scsi host pointer. ++ **/ ++static void ++lpfc_get_host_symbolic_name(struct Scsi_Host *shost) ++{ ++ struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; ++ ++ lpfc_vport_symbolic_node_name(vport, fc_host_symbolic_name(shost), ++ sizeof fc_host_symbolic_name(shost)); ++} ++ ++/** + * lpfc_get_host_port_id - Copy the vport DID into the scsi host port id + * @shost: kernel scsi host pointer. + **/ +@@ -5667,6 +5680,8 @@ struct fc_function_template lpfc_transpo + .show_host_supported_fc4s = 1, + .show_host_supported_speeds = 1, + .show_host_maxframe_size = 1, ++ ++ .get_host_symbolic_name = lpfc_get_host_symbolic_name, + .show_host_symbolic_name = 1, + + /* dynamic attributes the driver supports */ +@@ -5734,6 +5749,8 @@ struct fc_function_template lpfc_vport_t + .show_host_supported_fc4s = 1, + .show_host_supported_speeds = 1, + .show_host_maxframe_size = 1, ++ ++ .get_host_symbolic_name = lpfc_get_host_symbolic_name, + .show_host_symbolic_name = 1, + + /* dynamic attributes the driver supports */ diff --git a/queue-4.9/scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch b/queue-4.9/scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch new file mode 100644 index 00000000000..e8bb8b8c42e --- /dev/null +++ b/queue-4.9/scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: James Smart +Date: Mon, 19 Dec 2016 15:07:23 -0800 +Subject: scsi: lpfc: Correct issue leading to oops during link reset + +From: James Smart + + +[ Upstream commit e6c6acc0e0223ddaf867628d420ee196349c6fae ] + +Correct issue leading to oops during link reset. Missing vport pointer. + +[mkp: fixed typo] + +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Reviewed-by: Hannes Reinecke +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/lpfc/lpfc_sli.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/scsi/lpfc/lpfc_sli.c ++++ b/drivers/scsi/lpfc/lpfc_sli.c +@@ -10006,6 +10006,7 @@ lpfc_sli_abort_iotag_issue(struct lpfc_h + iabt->ulpCommand = CMD_CLOSE_XRI_CN; + + abtsiocbp->iocb_cmpl = lpfc_sli_abort_els_cmpl; ++ abtsiocbp->vport = vport; + + lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, + "0339 Abort xri x%x, original iotag x%x, " diff --git a/queue-4.9/scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch b/queue-4.9/scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch new file mode 100644 index 00000000000..6c78b555702 --- /dev/null +++ b/queue-4.9/scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch @@ -0,0 +1,47 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: James Smart +Date: Mon, 19 Dec 2016 15:07:25 -0800 +Subject: scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort + +From: James Smart + + +[ Upstream commit 104450eb08ca662e6b1d02da11aca9598e978f3e ] + +FCoE VPort enable-disable does not bring up the VPort. +VPI structure needed to be initialized before being re-registered. + +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Reviewed-by: Hannes Reinecke +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/lpfc/lpfc_vport.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/scsi/lpfc/lpfc_vport.c ++++ b/drivers/scsi/lpfc/lpfc_vport.c +@@ -537,6 +537,12 @@ enable_vport(struct fc_vport *fc_vport) + + spin_lock_irq(shost->host_lock); + vport->load_flag |= FC_LOADING; ++ if (vport->fc_flag & FC_VPORT_NEEDS_INIT_VPI) { ++ spin_unlock_irq(shost->host_lock); ++ lpfc_issue_init_vpi(vport); ++ goto out; ++ } ++ + vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; + spin_unlock_irq(shost->host_lock); + +@@ -557,6 +563,8 @@ enable_vport(struct fc_vport *fc_vport) + } else { + lpfc_vport_set_state(vport, FC_VPORT_FAILED); + } ++ ++out: + lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, + "1827 Vport Enabled.\n"); + return VPORT_OK; diff --git a/queue-4.9/scsi-ufs-add-capability-to-keep-auto-bkops-always-enabled.patch b/queue-4.9/scsi-ufs-add-capability-to-keep-auto-bkops-always-enabled.patch new file mode 100644 index 00000000000..316c56a7e6b --- /dev/null +++ b/queue-4.9/scsi-ufs-add-capability-to-keep-auto-bkops-always-enabled.patch @@ -0,0 +1,112 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: "subhashj@codeaurora.org" +Date: Thu, 22 Dec 2016 18:41:22 -0800 +Subject: scsi: ufs: add capability to keep auto bkops always enabled + +From: "subhashj@codeaurora.org" + + +[ Upstream commit 4e768e7645ec4ffa92ee163643777b261ae97142 ] + +UFS device requires to perform bkops (back ground operations) periodically +but host can control (via auto-bkops parameter of device) when device can +perform bkops based on its performance requirements. In general, host +would like to enable the device's auto-bkops only when it's not doing any +regular data transfer but sometimes device may not behave properly if host +keeps the auto-bkops disabled. This change adds the capability to let the +device auto-bkops always enabled except suspend. + +Reviewed-by: Sahitya Tummala +Signed-off-by: Subhash Jadavani +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/ufs/ufshcd.c | 33 ++++++++++++++++++++++----------- + drivers/scsi/ufs/ufshcd.h | 13 +++++++++++++ + 2 files changed, 35 insertions(+), 11 deletions(-) + +--- a/drivers/scsi/ufs/ufshcd.c ++++ b/drivers/scsi/ufs/ufshcd.c +@@ -3781,18 +3781,25 @@ out: + } + + /** +- * ufshcd_force_reset_auto_bkops - force enable of auto bkops ++ * ufshcd_force_reset_auto_bkops - force reset auto bkops state + * @hba: per adapter instance + * + * After a device reset the device may toggle the BKOPS_EN flag + * to default value. The s/w tracking variables should be updated +- * as well. Do this by forcing enable of auto bkops. ++ * as well. This function would change the auto-bkops state based on ++ * UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND. + */ +-static void ufshcd_force_reset_auto_bkops(struct ufs_hba *hba) ++static void ufshcd_force_reset_auto_bkops(struct ufs_hba *hba) + { +- hba->auto_bkops_enabled = false; +- hba->ee_ctrl_mask |= MASK_EE_URGENT_BKOPS; +- ufshcd_enable_auto_bkops(hba); ++ if (ufshcd_keep_autobkops_enabled_except_suspend(hba)) { ++ hba->auto_bkops_enabled = false; ++ hba->ee_ctrl_mask |= MASK_EE_URGENT_BKOPS; ++ ufshcd_enable_auto_bkops(hba); ++ } else { ++ hba->auto_bkops_enabled = true; ++ hba->ee_ctrl_mask &= ~MASK_EE_URGENT_BKOPS; ++ ufshcd_disable_auto_bkops(hba); ++ } + } + + static inline int ufshcd_get_bkops_status(struct ufs_hba *hba, u32 *status) +@@ -6138,11 +6145,15 @@ static int ufshcd_resume(struct ufs_hba + goto set_old_link_state; + } + +- /* +- * If BKOPs operations are urgently needed at this moment then +- * keep auto-bkops enabled or else disable it. +- */ +- ufshcd_urgent_bkops(hba); ++ if (ufshcd_keep_autobkops_enabled_except_suspend(hba)) ++ ufshcd_enable_auto_bkops(hba); ++ else ++ /* ++ * If BKOPs operations are urgently needed at this moment then ++ * keep auto-bkops enabled or else disable it. ++ */ ++ ufshcd_urgent_bkops(hba); ++ + hba->clk_gating.is_suspended = false; + + if (ufshcd_is_clkscaling_enabled(hba)) +--- a/drivers/scsi/ufs/ufshcd.h ++++ b/drivers/scsi/ufs/ufshcd.h +@@ -548,6 +548,14 @@ struct ufs_hba { + * CAUTION: Enabling this might reduce overall UFS throughput. + */ + #define UFSHCD_CAP_INTR_AGGR (1 << 4) ++ /* ++ * This capability allows the device auto-bkops to be always enabled ++ * except during suspend (both runtime and suspend). ++ * Enabling this capability means that device will always be allowed ++ * to do background operation when it's active but it might degrade ++ * the performance of ongoing read/write operations. ++ */ ++#define UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND (1 << 5) + + struct devfreq *devfreq; + struct ufs_clk_scaling clk_scaling; +@@ -645,6 +653,11 @@ static inline void *ufshcd_get_variant(s + BUG_ON(!hba); + return hba->priv; + } ++static inline bool ufshcd_keep_autobkops_enabled_except_suspend( ++ struct ufs_hba *hba) ++{ ++ return hba->caps & UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND; ++} + + extern int ufshcd_runtime_suspend(struct ufs_hba *hba); + extern int ufshcd_runtime_resume(struct ufs_hba *hba); diff --git a/queue-4.9/scsi-ufs-qcom-fix-module-autoload.patch b/queue-4.9/scsi-ufs-qcom-fix-module-autoload.patch new file mode 100644 index 00000000000..ee69863a507 --- /dev/null +++ b/queue-4.9/scsi-ufs-qcom-fix-module-autoload.patch @@ -0,0 +1,46 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Javier Martinez Canillas +Date: Mon, 2 Jan 2017 11:04:58 -0300 +Subject: scsi: ufs-qcom: Fix module autoload + +From: Javier Martinez Canillas + + +[ Upstream commit ab3dabb3e8cf077850f20610f73a0def1fed10cb ] + +If the driver is built as a module, autoload won't work because the module +alias information is not filled. So user-space can't match the registered +device with the corresponding module. + +Export the module alias information using the MODULE_DEVICE_TABLE() macro. + +Before this patch: + +$ modinfo drivers/scsi/ufs/ufs-qcom.ko | grep alias +$ + +After this patch: + +$ modinfo drivers/scsi/ufs/ufs-qcom.ko | grep alias +alias: of:N*T*Cqcom,ufshcC* +alias: of:N*T*Cqcom,ufshc + +Signed-off-by: Javier Martinez Canillas +Reviewed-by: Subhash Jadavani +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/ufs/ufs-qcom.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/scsi/ufs/ufs-qcom.c ++++ b/drivers/scsi/ufs/ufs-qcom.c +@@ -1689,6 +1689,7 @@ static const struct of_device_id ufs_qco + { .compatible = "qcom,ufshc"}, + {}, + }; ++MODULE_DEVICE_TABLE(of, ufs_qcom_of_match); + + static const struct dev_pm_ops ufs_qcom_pm_ops = { + .suspend = ufshcd_pltfrm_suspend, diff --git a/queue-4.9/series b/queue-4.9/series index 5f150f2e19f..d98b3928439 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -1,2 +1,61 @@ media-imon-fix-null-ptr-deref-in-imon_probe.patch media-dib0700-fix-invalid-dvb_detach-argument.patch +arm-crypto-reduce-priority-of-bit-sliced-aes-cipher.patch +bluetooth-btusb-fix-qca-rome-suspend-resume.patch +extcon-remove-potential-problem-when-calling-extcon_register_notifier.patch +extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch +fm10k-request-reset-when-mbx-state-changes.patch +arm-dts-fix-compatible-for-ti81xx-uarts-for-8250.patch +arm-dts-fix-am335x-and-dm814x-scm-syscon-to-probe-children.patch +arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch +arm-dts-fix-omap3-off-mode-pull-defines.patch +arm-dts-omap5-uevm-allow-bootloader-to-configure-usb-ethernet-mac.patch +ata-ata_bmdma-should-depend-on-has_dma.patch +ata-sata_highbank-should-depend-on-has_dma.patch +ata-sata_mv-should-depend-on-has_dma.patch +drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch +igb-reset-the-phy-before-reading-the-phy-id.patch +igb-close-suspend-race-in-netif_device_detach.patch +igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch +scsi-ufs-qcom-fix-module-autoload.patch +scsi-ufs-add-capability-to-keep-auto-bkops-always-enabled.patch +tcp-provide-timestamps-for-partial-writes.patch +staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch +x86-irq-trace-add-__irq_entry-annotation-to-x86-s-platform-irq-handlers.patch +scsi-lpfc-add-missing-memory-barrier.patch +scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch +scsi-lpfc-correct-host-name-in-symbolic_name-field.patch +scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch +scsi-lpfc-clear-the-vendorversion-in-the-plogi-plogi-acc-payload.patch +rtc-rx8010-change-lock-mechanism.patch +power-supply-axp288_fuel_gauge-read-15-bit-values-2-registers-at-a-time.patch +power-supply-axp288_fuel_gauge-read-12-bit-values-2-registers-at-a-time.patch +alsa-vx-don-t-try-to-update-capture-stream-before-running.patch +alsa-vx-fix-possible-transfer-overflow.patch +drm-omap-panel-sony-acx565akm.c-add-module_alias.patch +backlight-lcd-fix-race-condition-during-register.patch +backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch +gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch +alsa-hda-realtek-add-new-codec-id-alc299.patch +arm64-dts-ns2-reserve-memory-for-nitro-firmware.patch +ixgbe-configure-advertised-speeds-correctly-for-kr-kx-backplane.patch +ixgbe-fix-aer-error-handling.patch +ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch +ixgbe-fix-reporting-of-100mb-capability.patch +ixgbe-reduce-i2c-retry-count-on-x550-devices.patch +ixgbe-add-mask-for-64-rss-queues.patch +ixgbe-do-not-disable-fec-from-the-driver.patch +staging-rtl8712-fixed-little-endian-problem.patch +staging-wilc1000-fix-endian-sparse-warning.patch +staging-greybus-add-host-device-function-pointer-checks.patch +mips-end-asm-function-prologue-macros-with-.insn.patch +mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch +mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch +mips-traps-ensure-l1-l2-ecc-checking-match-for-cm3-systems.patch +mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch +revert-crypto-xts-add-ecb-dependency.patch +revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch +uapi-fix-linux-rds.h-userspace-compilation-error.patch +uapi-fix-linux-rds.h-userspace-compilation-errors.patch +revert-dt-bindings-add-vendor-prefix-for-lego.patch +revert-dt-bindings-add-lego-mindstorms-ev3-compatible-specification.patch diff --git a/queue-4.9/staging-greybus-add-host-device-function-pointer-checks.patch b/queue-4.9/staging-greybus-add-host-device-function-pointer-checks.patch new file mode 100644 index 00000000000..71ddbd22318 --- /dev/null +++ b/queue-4.9/staging-greybus-add-host-device-function-pointer-checks.patch @@ -0,0 +1,47 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Jason Hrycay +Date: Tue, 20 Dec 2016 14:49:27 -0600 +Subject: staging: greybus: add host device function pointer checks + +From: Jason Hrycay + + +[ Upstream commit f05a88a39c5b5f226e08e626998bb920723b7d85 ] + +Add sanity checks for cport_quiesce and cport_clear before invoking the +callbacks as these function pointers are not required during the host +device registration. This follows the logic implemented elsewhere for +various other function pointers. + +Signed-off-by: Jason Hrycay +Reviewed-by: Bryan O'Donoghue +Acked-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/greybus/connection.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/staging/greybus/connection.c ++++ b/drivers/staging/greybus/connection.c +@@ -357,6 +357,9 @@ static int gb_connection_hd_cport_quiesc + size_t peer_space; + int ret; + ++ if (!hd->driver->cport_quiesce) ++ return 0; ++ + peer_space = sizeof(struct gb_operation_msg_hdr) + + sizeof(struct gb_cport_shutdown_request); + +@@ -380,6 +383,9 @@ static int gb_connection_hd_cport_clear( + struct gb_host_device *hd = connection->hd; + int ret; + ++ if (!hd->driver->cport_clear) ++ return 0; ++ + ret = hd->driver->cport_clear(hd, connection->hd_cport_id); + if (ret) { + dev_err(&hd->dev, "%s: failed to clear host cport: %d\n", diff --git a/queue-4.9/staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch b/queue-4.9/staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch new file mode 100644 index 00000000000..d09e2861466 --- /dev/null +++ b/queue-4.9/staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch @@ -0,0 +1,49 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Galo Navarro +Date: Tue, 3 Jan 2017 23:12:09 +0100 +Subject: staging: rtl8188eu: fix incorrect ERROR tags from logs + +From: Galo Navarro + + +[ Upstream commit 401579c22ccbcb54244494069973e64b1fe980d2 ] + +Several lifecycle events in the rtl8188eu driver are logged using the +DBG_88E_LEVEL macro from rtw_debug.h, which is tagged as ERROR +regardless of the actual level. Below are dmesg excerpts after loading +and unloading the module, the messages are misleading as there was no +error. + + [517434.916239] usbcore: registered new interface driver r8188eu + [517435.680653] R8188EU: ERROR indicate disassoc + [517437.122606] R8188EU: ERROR assoc success + [517797.735611] usbcore: deregistering interface driver r8188eu + [517797.736069] R8188EU: ERROR indicate disassoc + +Remove the ERROR prefix from the logs. After the patch, logs are: + + [517949.873976] usbcore: registered new interface driver r8188eu + [517950.592845] R8188EU: indicate disassoc + [517951.993973] R8188EU: assoc success + [521778.784448] usbcore: deregistering interface driver r8188eu + [521778.784838] R8188EU: indicate disassoc + +Signed-off-by: Galo Navarro +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/rtl8188eu/include/rtw_debug.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/rtl8188eu/include/rtw_debug.h ++++ b/drivers/staging/rtl8188eu/include/rtw_debug.h +@@ -70,7 +70,7 @@ extern u32 GlobalDebugLevel; + #define DBG_88E_LEVEL(_level, fmt, arg...) \ + do { \ + if (_level <= GlobalDebugLevel) \ +- pr_info(DRIVER_PREFIX"ERROR " fmt, ##arg); \ ++ pr_info(DRIVER_PREFIX fmt, ##arg); \ + } while (0) + + #define DBG_88E(...) \ diff --git a/queue-4.9/staging-rtl8712-fixed-little-endian-problem.patch b/queue-4.9/staging-rtl8712-fixed-little-endian-problem.patch new file mode 100644 index 00000000000..5e1c77bec3a --- /dev/null +++ b/queue-4.9/staging-rtl8712-fixed-little-endian-problem.patch @@ -0,0 +1,33 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Jannik Becher +Date: Tue, 20 Dec 2016 18:59:46 +0100 +Subject: staging: rtl8712: fixed little endian problem + +From: Jannik Becher + + +[ Upstream commit 502c80744fcac6b16f28699469c70db499fe2f69 ] + +Fixed a sparse warning. +Using function le16_to_cpus() to avoid double assignment. + +Signed-off-by: Jannik Becher +Tested-by: Larry Finger +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c ++++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +@@ -199,7 +199,7 @@ static noinline_for_stack char *translat + iwe.cmd = SIOCGIWMODE; + memcpy((u8 *)&cap, r8712_get_capability_from_ie(pnetwork->network.IEs), + 2); +- cap = le16_to_cpu(cap); ++ le16_to_cpus(&cap); + if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_BSS)) { + if (cap & WLAN_CAPABILITY_BSS) + iwe.u.mode = (u32)IW_MODE_MASTER; diff --git a/queue-4.9/staging-wilc1000-fix-endian-sparse-warning.patch b/queue-4.9/staging-wilc1000-fix-endian-sparse-warning.patch new file mode 100644 index 00000000000..fb62803f3d9 --- /dev/null +++ b/queue-4.9/staging-wilc1000-fix-endian-sparse-warning.patch @@ -0,0 +1,31 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Mike Kofron +Date: Thu, 29 Dec 2016 16:35:48 -0500 +Subject: staging: wilc1000: Fix endian sparse warning + +From: Mike Kofron + + +[ Upstream commit 94500d5667386119c27725fe314f6882f68580a9 ] + +drivers/staging/wilc1000/linux_wlan.c:995:18: warning: restricted __be16 degrades to integer + +Signed-off-by: Mike Kofron +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/wilc1000/linux_wlan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/wilc1000/linux_wlan.c ++++ b/drivers/staging/wilc1000/linux_wlan.c +@@ -1001,7 +1001,7 @@ int wilc_mac_xmit(struct sk_buff *skb, s + tx_data->skb = skb; + + eth_h = (struct ethhdr *)(skb->data); +- if (eth_h->h_proto == 0x8e88) ++ if (eth_h->h_proto == cpu_to_be16(0x8e88)) + netdev_dbg(ndev, "EAPOL transmitted\n"); + + ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr)); diff --git a/queue-4.9/tcp-provide-timestamps-for-partial-writes.patch b/queue-4.9/tcp-provide-timestamps-for-partial-writes.patch new file mode 100644 index 00000000000..89d12a2c2f7 --- /dev/null +++ b/queue-4.9/tcp-provide-timestamps-for-partial-writes.patch @@ -0,0 +1,104 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Soheil Hassas Yeganeh +Date: Wed, 4 Jan 2017 11:19:34 -0500 +Subject: tcp: provide timestamps for partial writes + +From: Soheil Hassas Yeganeh + + +[ Upstream commit ad02c4f547826167a709dab8a89a1caefd2c1f50 ] + +For TCP sockets, TX timestamps are only captured when the user data +is successfully and fully written to the socket. In many cases, +however, TCP writes can be partial for which no timestamp is +collected. + +Collect timestamps whenever any user data is (fully or partially) +copied into the socket. Pass tcp_write_queue_tail to tcp_tx_timestamp +instead of the local skb pointer since it can be set to NULL on +the error path. + +Note that tcp_write_queue_tail can be NULL, even if bytes have been +copied to the socket. This is because acknowledgements are being +processed in tcp_sendmsg(), and by the time tcp_tx_timestamp is +called tcp_write_queue_tail can be NULL. For such cases, this patch +does not collect any timestamps (i.e., it is best-effort). + +This patch is written with suggestions from Willem de Bruijn and +Eric Dumazet. + +Change-log V1 -> V2: + - Use sockc.tsflags instead of sk->sk_tsflags. + - Use the same code path for normal writes and errors. + +Signed-off-by: Soheil Hassas Yeganeh +Acked-by: Yuchung Cheng +Cc: Willem de Bruijn +Cc: Eric Dumazet +Cc: Neal Cardwell +Cc: Martin KaFai Lau +Acked-by: Willem de Bruijn +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/tcp.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +--- a/net/ipv4/tcp.c ++++ b/net/ipv4/tcp.c +@@ -431,7 +431,7 @@ EXPORT_SYMBOL(tcp_init_sock); + + static void tcp_tx_timestamp(struct sock *sk, u16 tsflags, struct sk_buff *skb) + { +- if (tsflags) { ++ if (tsflags && skb) { + struct skb_shared_info *shinfo = skb_shinfo(skb); + struct tcp_skb_cb *tcb = TCP_SKB_CB(skb); + +@@ -966,10 +966,8 @@ new_segment: + copied += copy; + offset += copy; + size -= copy; +- if (!size) { +- tcp_tx_timestamp(sk, sk->sk_tsflags, skb); ++ if (!size) + goto out; +- } + + if (skb->len < size_goal || (flags & MSG_OOB)) + continue; +@@ -995,8 +993,11 @@ wait_for_memory: + } + + out: +- if (copied && !(flags & MSG_SENDPAGE_NOTLAST)) +- tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); ++ if (copied) { ++ tcp_tx_timestamp(sk, sk->sk_tsflags, tcp_write_queue_tail(sk)); ++ if (!(flags & MSG_SENDPAGE_NOTLAST)) ++ tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); ++ } + return copied; + + do_error: +@@ -1289,7 +1290,6 @@ new_segment: + + copied += copy; + if (!msg_data_left(msg)) { +- tcp_tx_timestamp(sk, sockc.tsflags, skb); + if (unlikely(flags & MSG_EOR)) + TCP_SKB_CB(skb)->eor = 1; + goto out; +@@ -1320,8 +1320,10 @@ wait_for_memory: + } + + out: +- if (copied) ++ if (copied) { ++ tcp_tx_timestamp(sk, sockc.tsflags, tcp_write_queue_tail(sk)); + tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); ++ } + out_nopush: + release_sock(sk); + return copied + copied_syn; diff --git a/queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-error.patch b/queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-error.patch new file mode 100644 index 00000000000..c16d1948c25 --- /dev/null +++ b/queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-error.patch @@ -0,0 +1,45 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: "Dmitry V. Levin" +Date: Thu, 16 Feb 2017 18:05:45 +0300 +Subject: uapi: fix linux/rds.h userspace compilation error + +From: "Dmitry V. Levin" + + +[ Upstream commit 1786dbf3702e33ce3afd2d3dbe630bd04b1d2e58 ] + +On the kernel side, sockaddr_storage is #define'd to +__kernel_sockaddr_storage. Replacing struct sockaddr_storage with +struct __kernel_sockaddr_storage defined by fixes +the following linux/rds.h userspace compilation error: + +/usr/include/linux/rds.h:226:26: error: field 'dest_addr' has incomplete type + struct sockaddr_storage dest_addr; + +Signed-off-by: Dmitry V. Levin +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + include/uapi/linux/rds.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/include/uapi/linux/rds.h ++++ b/include/uapi/linux/rds.h +@@ -35,6 +35,7 @@ + #define _LINUX_RDS_H + + #include ++#include /* For __kernel_sockaddr_storage. */ + + #define RDS_IB_ABI_VERSION 0x301 + +@@ -223,7 +224,7 @@ struct rds_get_mr_args { + }; + + struct rds_get_mr_for_dest_args { +- struct sockaddr_storage dest_addr; ++ struct __kernel_sockaddr_storage dest_addr; + struct rds_iovec vec; + uint64_t cookie_addr; + uint64_t flags; diff --git a/queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-errors.patch b/queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-errors.patch new file mode 100644 index 00000000000..413c984cb62 --- /dev/null +++ b/queue-4.9/uapi-fix-linux-rds.h-userspace-compilation-errors.patch @@ -0,0 +1,319 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: "Dmitry V. Levin" +Date: Thu, 16 Feb 2017 18:05:13 +0300 +Subject: uapi: fix linux/rds.h userspace compilation errors + +From: "Dmitry V. Levin" + + +[ Upstream commit feb0869d90e51ce8b6fd8a46588465b1b5a26d09 ] + +Consistently use types from linux/types.h to fix the following +linux/rds.h userspace compilation errors: + +/usr/include/linux/rds.h:106:2: error: unknown type name 'uint8_t' + uint8_t name[32]; +/usr/include/linux/rds.h:107:2: error: unknown type name 'uint64_t' + uint64_t value; +/usr/include/linux/rds.h:117:2: error: unknown type name 'uint64_t' + uint64_t next_tx_seq; +/usr/include/linux/rds.h:118:2: error: unknown type name 'uint64_t' + uint64_t next_rx_seq; +/usr/include/linux/rds.h:121:2: error: unknown type name 'uint8_t' + uint8_t transport[TRANSNAMSIZ]; /* null term ascii */ +/usr/include/linux/rds.h:122:2: error: unknown type name 'uint8_t' + uint8_t flags; +/usr/include/linux/rds.h:129:2: error: unknown type name 'uint64_t' + uint64_t seq; +/usr/include/linux/rds.h:130:2: error: unknown type name 'uint32_t' + uint32_t len; +/usr/include/linux/rds.h:135:2: error: unknown type name 'uint8_t' + uint8_t flags; +/usr/include/linux/rds.h:139:2: error: unknown type name 'uint32_t' + uint32_t sndbuf; +/usr/include/linux/rds.h:144:2: error: unknown type name 'uint32_t' + uint32_t rcvbuf; +/usr/include/linux/rds.h:145:2: error: unknown type name 'uint64_t' + uint64_t inum; +/usr/include/linux/rds.h:153:2: error: unknown type name 'uint64_t' + uint64_t hdr_rem; +/usr/include/linux/rds.h:154:2: error: unknown type name 'uint64_t' + uint64_t data_rem; +/usr/include/linux/rds.h:155:2: error: unknown type name 'uint32_t' + uint32_t last_sent_nxt; +/usr/include/linux/rds.h:156:2: error: unknown type name 'uint32_t' + uint32_t last_expected_una; +/usr/include/linux/rds.h:157:2: error: unknown type name 'uint32_t' + uint32_t last_seen_una; +/usr/include/linux/rds.h:164:2: error: unknown type name 'uint8_t' + uint8_t src_gid[RDS_IB_GID_LEN]; +/usr/include/linux/rds.h:165:2: error: unknown type name 'uint8_t' + uint8_t dst_gid[RDS_IB_GID_LEN]; +/usr/include/linux/rds.h:167:2: error: unknown type name 'uint32_t' + uint32_t max_send_wr; +/usr/include/linux/rds.h:168:2: error: unknown type name 'uint32_t' + uint32_t max_recv_wr; +/usr/include/linux/rds.h:169:2: error: unknown type name 'uint32_t' + uint32_t max_send_sge; +/usr/include/linux/rds.h:170:2: error: unknown type name 'uint32_t' + uint32_t rdma_mr_max; +/usr/include/linux/rds.h:171:2: error: unknown type name 'uint32_t' + uint32_t rdma_mr_size; +/usr/include/linux/rds.h:212:9: error: unknown type name 'uint64_t' + typedef uint64_t rds_rdma_cookie_t; +/usr/include/linux/rds.h:215:2: error: unknown type name 'uint64_t' + uint64_t addr; +/usr/include/linux/rds.h:216:2: error: unknown type name 'uint64_t' + uint64_t bytes; +/usr/include/linux/rds.h:221:2: error: unknown type name 'uint64_t' + uint64_t cookie_addr; +/usr/include/linux/rds.h:222:2: error: unknown type name 'uint64_t' + uint64_t flags; +/usr/include/linux/rds.h:228:2: error: unknown type name 'uint64_t' + uint64_t cookie_addr; +/usr/include/linux/rds.h:229:2: error: unknown type name 'uint64_t' + uint64_t flags; +/usr/include/linux/rds.h:234:2: error: unknown type name 'uint64_t' + uint64_t flags; +/usr/include/linux/rds.h:240:2: error: unknown type name 'uint64_t' + uint64_t local_vec_addr; +/usr/include/linux/rds.h:241:2: error: unknown type name 'uint64_t' + uint64_t nr_local; +/usr/include/linux/rds.h:242:2: error: unknown type name 'uint64_t' + uint64_t flags; +/usr/include/linux/rds.h:243:2: error: unknown type name 'uint64_t' + uint64_t user_token; +/usr/include/linux/rds.h:248:2: error: unknown type name 'uint64_t' + uint64_t local_addr; +/usr/include/linux/rds.h:249:2: error: unknown type name 'uint64_t' + uint64_t remote_addr; +/usr/include/linux/rds.h:252:4: error: unknown type name 'uint64_t' + uint64_t compare; +/usr/include/linux/rds.h:253:4: error: unknown type name 'uint64_t' + uint64_t swap; +/usr/include/linux/rds.h:256:4: error: unknown type name 'uint64_t' + uint64_t add; +/usr/include/linux/rds.h:259:4: error: unknown type name 'uint64_t' + uint64_t compare; +/usr/include/linux/rds.h:260:4: error: unknown type name 'uint64_t' + uint64_t swap; +/usr/include/linux/rds.h:261:4: error: unknown type name 'uint64_t' + uint64_t compare_mask; +/usr/include/linux/rds.h:262:4: error: unknown type name 'uint64_t' + uint64_t swap_mask; +/usr/include/linux/rds.h:265:4: error: unknown type name 'uint64_t' + uint64_t add; +/usr/include/linux/rds.h:266:4: error: unknown type name 'uint64_t' + uint64_t nocarry_mask; +/usr/include/linux/rds.h:269:2: error: unknown type name 'uint64_t' + uint64_t flags; +/usr/include/linux/rds.h:270:2: error: unknown type name 'uint64_t' + uint64_t user_token; +/usr/include/linux/rds.h:274:2: error: unknown type name 'uint64_t' + uint64_t user_token; +/usr/include/linux/rds.h:275:2: error: unknown type name 'int32_t' + int32_t status; + +Signed-off-by: Dmitry V. Levin +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + include/uapi/linux/rds.h | 102 +++++++++++++++++++++++------------------------ + 1 file changed, 51 insertions(+), 51 deletions(-) + +--- a/include/uapi/linux/rds.h ++++ b/include/uapi/linux/rds.h +@@ -104,8 +104,8 @@ + #define RDS_INFO_LAST 10010 + + struct rds_info_counter { +- uint8_t name[32]; +- uint64_t value; ++ __u8 name[32]; ++ __u64 value; + } __attribute__((packed)); + + #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 +@@ -115,35 +115,35 @@ struct rds_info_counter { + #define TRANSNAMSIZ 16 + + struct rds_info_connection { +- uint64_t next_tx_seq; +- uint64_t next_rx_seq; ++ __u64 next_tx_seq; ++ __u64 next_rx_seq; + __be32 laddr; + __be32 faddr; +- uint8_t transport[TRANSNAMSIZ]; /* null term ascii */ +- uint8_t flags; ++ __u8 transport[TRANSNAMSIZ]; /* null term ascii */ ++ __u8 flags; + } __attribute__((packed)); + + #define RDS_INFO_MESSAGE_FLAG_ACK 0x01 + #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 + + struct rds_info_message { +- uint64_t seq; +- uint32_t len; ++ __u64 seq; ++ __u32 len; + __be32 laddr; + __be32 faddr; + __be16 lport; + __be16 fport; +- uint8_t flags; ++ __u8 flags; + } __attribute__((packed)); + + struct rds_info_socket { +- uint32_t sndbuf; ++ __u32 sndbuf; + __be32 bound_addr; + __be32 connected_addr; + __be16 bound_port; + __be16 connected_port; +- uint32_t rcvbuf; +- uint64_t inum; ++ __u32 rcvbuf; ++ __u64 inum; + } __attribute__((packed)); + + struct rds_info_tcp_socket { +@@ -151,25 +151,25 @@ struct rds_info_tcp_socket { + __be16 local_port; + __be32 peer_addr; + __be16 peer_port; +- uint64_t hdr_rem; +- uint64_t data_rem; +- uint32_t last_sent_nxt; +- uint32_t last_expected_una; +- uint32_t last_seen_una; ++ __u64 hdr_rem; ++ __u64 data_rem; ++ __u32 last_sent_nxt; ++ __u32 last_expected_una; ++ __u32 last_seen_una; + } __attribute__((packed)); + + #define RDS_IB_GID_LEN 16 + struct rds_info_rdma_connection { + __be32 src_addr; + __be32 dst_addr; +- uint8_t src_gid[RDS_IB_GID_LEN]; +- uint8_t dst_gid[RDS_IB_GID_LEN]; ++ __u8 src_gid[RDS_IB_GID_LEN]; ++ __u8 dst_gid[RDS_IB_GID_LEN]; + +- uint32_t max_send_wr; +- uint32_t max_recv_wr; +- uint32_t max_send_sge; +- uint32_t rdma_mr_max; +- uint32_t rdma_mr_size; ++ __u32 max_send_wr; ++ __u32 max_recv_wr; ++ __u32 max_send_sge; ++ __u32 rdma_mr_max; ++ __u32 rdma_mr_size; + }; + + /* +@@ -210,70 +210,70 @@ struct rds_info_rdma_connection { + * (so that the application does not have to worry about + * alignment). + */ +-typedef uint64_t rds_rdma_cookie_t; ++typedef __u64 rds_rdma_cookie_t; + + struct rds_iovec { +- uint64_t addr; +- uint64_t bytes; ++ __u64 addr; ++ __u64 bytes; + }; + + struct rds_get_mr_args { + struct rds_iovec vec; +- uint64_t cookie_addr; +- uint64_t flags; ++ __u64 cookie_addr; ++ __u64 flags; + }; + + struct rds_get_mr_for_dest_args { + struct __kernel_sockaddr_storage dest_addr; + struct rds_iovec vec; +- uint64_t cookie_addr; +- uint64_t flags; ++ __u64 cookie_addr; ++ __u64 flags; + }; + + struct rds_free_mr_args { + rds_rdma_cookie_t cookie; +- uint64_t flags; ++ __u64 flags; + }; + + struct rds_rdma_args { + rds_rdma_cookie_t cookie; + struct rds_iovec remote_vec; +- uint64_t local_vec_addr; +- uint64_t nr_local; +- uint64_t flags; +- uint64_t user_token; ++ __u64 local_vec_addr; ++ __u64 nr_local; ++ __u64 flags; ++ __u64 user_token; + }; + + struct rds_atomic_args { + rds_rdma_cookie_t cookie; +- uint64_t local_addr; +- uint64_t remote_addr; ++ __u64 local_addr; ++ __u64 remote_addr; + union { + struct { +- uint64_t compare; +- uint64_t swap; ++ __u64 compare; ++ __u64 swap; + } cswp; + struct { +- uint64_t add; ++ __u64 add; + } fadd; + struct { +- uint64_t compare; +- uint64_t swap; +- uint64_t compare_mask; +- uint64_t swap_mask; ++ __u64 compare; ++ __u64 swap; ++ __u64 compare_mask; ++ __u64 swap_mask; + } m_cswp; + struct { +- uint64_t add; +- uint64_t nocarry_mask; ++ __u64 add; ++ __u64 nocarry_mask; + } m_fadd; + }; +- uint64_t flags; +- uint64_t user_token; ++ __u64 flags; ++ __u64 user_token; + }; + + struct rds_rdma_notify { +- uint64_t user_token; +- int32_t status; ++ __u64 user_token; ++ __s32 status; + }; + + #define RDS_RDMA_SUCCESS 0 diff --git a/queue-4.9/x86-irq-trace-add-__irq_entry-annotation-to-x86-s-platform-irq-handlers.patch b/queue-4.9/x86-irq-trace-add-__irq_entry-annotation-to-x86-s-platform-irq-handlers.patch new file mode 100644 index 00000000000..baaec1151d0 --- /dev/null +++ b/queue-4.9/x86-irq-trace-add-__irq_entry-annotation-to-x86-s-platform-irq-handlers.patch @@ -0,0 +1,278 @@ +From foo@baz Sun Nov 19 11:32:28 CET 2017 +From: Daniel Bristot de Oliveira +Date: Wed, 4 Jan 2017 12:20:33 +0100 +Subject: x86/irq, trace: Add __irq_entry annotation to x86's platform IRQ handlers + +From: Daniel Bristot de Oliveira + + +[ Upstream commit c4158ff536439619fa342810cc575ae2c809f03f ] + +This patch adds the __irq_entry annotation to the default x86 +platform IRQ handlers. ftrace's function_graph tracer uses the +__irq_entry annotation to notify the entry and return of IRQ +handlers. + +For example, before the patch: + 354549.667252 | 3) d..1 | default_idle_call() { + 354549.667252 | 3) d..1 | arch_cpu_idle() { + 354549.667253 | 3) d..1 | default_idle() { + 354549.696886 | 3) d..1 | smp_trace_reschedule_interrupt() { + 354549.696886 | 3) d..1 | irq_enter() { + 354549.696886 | 3) d..1 | rcu_irq_enter() { + +After the patch: + 366416.254476 | 3) d..1 | arch_cpu_idle() { + 366416.254476 | 3) d..1 | default_idle() { + 366416.261566 | 3) d..1 ==========> | + 366416.261566 | 3) d..1 | smp_trace_reschedule_interrupt() { + 366416.261566 | 3) d..1 | irq_enter() { + 366416.261566 | 3) d..1 | rcu_irq_enter() { + +KASAN also uses this annotation. The smp_apic_timer_interrupt() +was already annotated. + +Signed-off-by: Daniel Bristot de Oliveira +Acked-by: Steven Rostedt (VMware) +Cc: Aaron Lu +Cc: Andrew Morton +Cc: Baoquan He +Cc: Borislav Petkov +Cc: Claudio Fontana +Cc: Denys Vlasenko +Cc: Dou Liyang +Cc: Gu Zheng +Cc: Hidehiro Kawai +Cc: Linus Torvalds +Cc: Nicolai Stange +Cc: Peter Zijlstra (Intel) +Cc: Steven Rostedt +Cc: Thomas Gleixner +Cc: Tony Luck +Cc: Wanpeng Li +Cc: linux-edac@vger.kernel.org +Link: http://lkml.kernel.org/r/059fdf437c2f0c09b13c18c8fe4e69999d3ffe69.1483528431.git.bristot@redhat.com +Signed-off-by: Ingo Molnar +Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/apic/apic.c | 8 ++++---- + arch/x86/kernel/apic/vector.c | 2 +- + arch/x86/kernel/cpu/mcheck/mce_amd.c | 4 ++-- + arch/x86/kernel/cpu/mcheck/therm_throt.c | 6 ++++-- + arch/x86/kernel/cpu/mcheck/threshold.c | 4 ++-- + arch/x86/kernel/irq.c | 4 ++-- + arch/x86/kernel/irq_work.c | 5 +++-- + arch/x86/kernel/smp.c | 15 +++++++++------ + 8 files changed, 27 insertions(+), 21 deletions(-) + +--- a/arch/x86/kernel/apic/apic.c ++++ b/arch/x86/kernel/apic/apic.c +@@ -1863,14 +1863,14 @@ static void __smp_spurious_interrupt(u8 + "should never happen.\n", vector, smp_processor_id()); + } + +-__visible void smp_spurious_interrupt(struct pt_regs *regs) ++__visible void __irq_entry smp_spurious_interrupt(struct pt_regs *regs) + { + entering_irq(); + __smp_spurious_interrupt(~regs->orig_ax); + exiting_irq(); + } + +-__visible void smp_trace_spurious_interrupt(struct pt_regs *regs) ++__visible void __irq_entry smp_trace_spurious_interrupt(struct pt_regs *regs) + { + u8 vector = ~regs->orig_ax; + +@@ -1921,14 +1921,14 @@ static void __smp_error_interrupt(struct + + } + +-__visible void smp_error_interrupt(struct pt_regs *regs) ++__visible void __irq_entry smp_error_interrupt(struct pt_regs *regs) + { + entering_irq(); + __smp_error_interrupt(regs); + exiting_irq(); + } + +-__visible void smp_trace_error_interrupt(struct pt_regs *regs) ++__visible void __irq_entry smp_trace_error_interrupt(struct pt_regs *regs) + { + entering_irq(); + trace_error_apic_entry(ERROR_APIC_VECTOR); +--- a/arch/x86/kernel/apic/vector.c ++++ b/arch/x86/kernel/apic/vector.c +@@ -559,7 +559,7 @@ void send_cleanup_vector(struct irq_cfg + __send_cleanup_vector(data); + } + +-asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) ++asmlinkage __visible void __irq_entry smp_irq_move_cleanup_interrupt(void) + { + unsigned vector, me; + +--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c ++++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c +@@ -593,14 +593,14 @@ static inline void __smp_deferred_error_ + deferred_error_int_vector(); + } + +-asmlinkage __visible void smp_deferred_error_interrupt(void) ++asmlinkage __visible void __irq_entry smp_deferred_error_interrupt(void) + { + entering_irq(); + __smp_deferred_error_interrupt(); + exiting_ack_irq(); + } + +-asmlinkage __visible void smp_trace_deferred_error_interrupt(void) ++asmlinkage __visible void __irq_entry smp_trace_deferred_error_interrupt(void) + { + entering_irq(); + trace_deferred_error_apic_entry(DEFERRED_ERROR_VECTOR); +--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c ++++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c +@@ -431,14 +431,16 @@ static inline void __smp_thermal_interru + smp_thermal_vector(); + } + +-asmlinkage __visible void smp_thermal_interrupt(struct pt_regs *regs) ++asmlinkage __visible void __irq_entry ++smp_thermal_interrupt(struct pt_regs *regs) + { + entering_irq(); + __smp_thermal_interrupt(); + exiting_ack_irq(); + } + +-asmlinkage __visible void smp_trace_thermal_interrupt(struct pt_regs *regs) ++asmlinkage __visible void __irq_entry ++smp_trace_thermal_interrupt(struct pt_regs *regs) + { + entering_irq(); + trace_thermal_apic_entry(THERMAL_APIC_VECTOR); +--- a/arch/x86/kernel/cpu/mcheck/threshold.c ++++ b/arch/x86/kernel/cpu/mcheck/threshold.c +@@ -24,14 +24,14 @@ static inline void __smp_threshold_inter + mce_threshold_vector(); + } + +-asmlinkage __visible void smp_threshold_interrupt(void) ++asmlinkage __visible void __irq_entry smp_threshold_interrupt(void) + { + entering_irq(); + __smp_threshold_interrupt(); + exiting_ack_irq(); + } + +-asmlinkage __visible void smp_trace_threshold_interrupt(void) ++asmlinkage __visible void __irq_entry smp_trace_threshold_interrupt(void) + { + entering_irq(); + trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR); +--- a/arch/x86/kernel/irq.c ++++ b/arch/x86/kernel/irq.c +@@ -265,7 +265,7 @@ void __smp_x86_platform_ipi(void) + x86_platform_ipi_callback(); + } + +-__visible void smp_x86_platform_ipi(struct pt_regs *regs) ++__visible void __irq_entry smp_x86_platform_ipi(struct pt_regs *regs) + { + struct pt_regs *old_regs = set_irq_regs(regs); + +@@ -316,7 +316,7 @@ __visible void smp_kvm_posted_intr_wakeu + } + #endif + +-__visible void smp_trace_x86_platform_ipi(struct pt_regs *regs) ++__visible void __irq_entry smp_trace_x86_platform_ipi(struct pt_regs *regs) + { + struct pt_regs *old_regs = set_irq_regs(regs); + +--- a/arch/x86/kernel/irq_work.c ++++ b/arch/x86/kernel/irq_work.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + + static inline void __smp_irq_work_interrupt(void) + { +@@ -16,14 +17,14 @@ static inline void __smp_irq_work_interr + irq_work_run(); + } + +-__visible void smp_irq_work_interrupt(struct pt_regs *regs) ++__visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs) + { + ipi_entering_ack_irq(); + __smp_irq_work_interrupt(); + exiting_irq(); + } + +-__visible void smp_trace_irq_work_interrupt(struct pt_regs *regs) ++__visible void __irq_entry smp_trace_irq_work_interrupt(struct pt_regs *regs) + { + ipi_entering_ack_irq(); + trace_irq_work_entry(IRQ_WORK_VECTOR); +--- a/arch/x86/kernel/smp.c ++++ b/arch/x86/kernel/smp.c +@@ -259,7 +259,7 @@ static inline void __smp_reschedule_inte + scheduler_ipi(); + } + +-__visible void smp_reschedule_interrupt(struct pt_regs *regs) ++__visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs) + { + irq_enter(); + ack_APIC_irq(); +@@ -270,7 +270,7 @@ __visible void smp_reschedule_interrupt( + */ + } + +-__visible void smp_trace_reschedule_interrupt(struct pt_regs *regs) ++__visible void __irq_entry smp_trace_reschedule_interrupt(struct pt_regs *regs) + { + /* + * Need to call irq_enter() before calling the trace point. +@@ -294,14 +294,15 @@ static inline void __smp_call_function_i + inc_irq_stat(irq_call_count); + } + +-__visible void smp_call_function_interrupt(struct pt_regs *regs) ++__visible void __irq_entry smp_call_function_interrupt(struct pt_regs *regs) + { + ipi_entering_ack_irq(); + __smp_call_function_interrupt(); + exiting_irq(); + } + +-__visible void smp_trace_call_function_interrupt(struct pt_regs *regs) ++__visible void __irq_entry ++smp_trace_call_function_interrupt(struct pt_regs *regs) + { + ipi_entering_ack_irq(); + trace_call_function_entry(CALL_FUNCTION_VECTOR); +@@ -316,14 +317,16 @@ static inline void __smp_call_function_s + inc_irq_stat(irq_call_count); + } + +-__visible void smp_call_function_single_interrupt(struct pt_regs *regs) ++__visible void __irq_entry ++smp_call_function_single_interrupt(struct pt_regs *regs) + { + ipi_entering_ack_irq(); + __smp_call_function_single_interrupt(); + exiting_irq(); + } + +-__visible void smp_trace_call_function_single_interrupt(struct pt_regs *regs) ++__visible void __irq_entry ++smp_trace_call_function_single_interrupt(struct pt_regs *regs) + { + ipi_entering_ack_irq(); + trace_call_function_single_entry(CALL_FUNCTION_SINGLE_VECTOR);