From: Greg Kroah-Hartman Date: Sun, 19 Nov 2017 11:17:14 +0000 (+0100) Subject: 3.18-stable patches X-Git-Tag: v3.18.83~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c012615f84c1e0f8af9583c69e807ee156b7122;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: alsa-vx-don-t-try-to-update-capture-stream-before-running.patch alsa-vx-fix-possible-transfer-overflow.patch arm-dts-fix-omap3-off-mode-pull-defines.patch arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.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 drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch extcon-palmas-check-the-parent-instance-to-prevent-the-null.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 iscsi-target-fix-iscsi_np-reset-hung-task-during-parallel-delete.patch ixgbe-fix-aer-error-handling.patch ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch mips-end-asm-function-prologue-macros-with-.insn.patch mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.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 scsi-lpfc-add-missing-memory-barrier.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 staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch uapi-fix-linux-rds.h-userspace-compilation-error.patch uapi-fix-linux-rds.h-userspace-compilation-errors.patch --- diff --git a/queue-3.18/alsa-vx-don-t-try-to-update-capture-stream-before-running.patch b/queue-3.18/alsa-vx-don-t-try-to-update-capture-stream-before-running.patch new file mode 100644 index 00000000000..c445784fefe --- /dev/null +++ b/queue-3.18/alsa-vx-don-t-try-to-update-capture-stream-before-running.patch @@ -0,0 +1,32 @@ +From foo@baz Sun Nov 19 12:16:40 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-3.18/alsa-vx-fix-possible-transfer-overflow.patch b/queue-3.18/alsa-vx-fix-possible-transfer-overflow.patch new file mode 100644 index 00000000000..1f35c6e118f --- /dev/null +++ b/queue-3.18/alsa-vx-fix-possible-transfer-overflow.patch @@ -0,0 +1,141 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -264,12 +264,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++; + } +@@ -279,7 +279,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++; + } +@@ -302,12 +302,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; +@@ -315,7 +315,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-3.18/arm-dts-fix-omap3-off-mode-pull-defines.patch b/queue-3.18/arm-dts-fix-omap3-off-mode-pull-defines.patch new file mode 100644 index 00000000000..bc69c17f0a1 --- /dev/null +++ b/queue-3.18/arm-dts-fix-omap3-off-mode-pull-defines.patch @@ -0,0 +1,43 @@ +From foo@baz Sun Nov 19 12:16:40 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-3.18/arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch b/queue-3.18/arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch new file mode 100644 index 00000000000..83bc030a309 --- /dev/null +++ b/queue-3.18/arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch @@ -0,0 +1,30 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -417,7 +417,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-3.18/ata-ata_bmdma-should-depend-on-has_dma.patch b/queue-3.18/ata-ata_bmdma-should-depend-on-has_dma.patch new file mode 100644 index 00000000000..748851121e9 --- /dev/null +++ b/queue-3.18/ata-ata_bmdma-should-depend-on-has_dma.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -245,6 +245,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-3.18/ata-sata_highbank-should-depend-on-has_dma.patch b/queue-3.18/ata-sata_highbank-should-depend-on-has_dma.patch new file mode 100644 index 00000000000..5ac7c5b450e --- /dev/null +++ b/queue-3.18/ata-sata_highbank-should-depend-on-has_dma.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -291,6 +291,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-3.18/ata-sata_mv-should-depend-on-has_dma.patch b/queue-3.18/ata-sata_mv-should-depend-on-has_dma.patch new file mode 100644 index 00000000000..48d2f04fa5d --- /dev/null +++ b/queue-3.18/ata-sata_mv-should-depend-on-has_dma.patch @@ -0,0 +1,36 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -301,6 +301,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-3.18/backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch b/queue-3.18/backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch new file mode 100644 index 00000000000..eda42df3efd --- /dev/null +++ b/queue-3.18/backlight-adp5520-fix-error-handling-in-adp5520_bl_probe.patch @@ -0,0 +1,48 @@ +From foo@baz Sun Nov 19 12:16:40 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-3.18/backlight-lcd-fix-race-condition-during-register.patch b/queue-3.18/backlight-lcd-fix-race-condition-during-register.patch new file mode 100644 index 00000000000..16fb918b0f5 --- /dev/null +++ b/queue-3.18/backlight-lcd-fix-race-condition-during-register.patch @@ -0,0 +1,43 @@ +From foo@baz Sun Nov 19 12:16:40 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-3.18/drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch b/queue-3.18/drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch new file mode 100644 index 00000000000..91f2fbc7146 --- /dev/null +++ b/queue-3.18/drm-sti-sti_vtg-handle-return-null-error-from-devm_ioremap_nocache.patch @@ -0,0 +1,35 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -303,6 +303,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-3.18/extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch b/queue-3.18/extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch new file mode 100644 index 00000000000..afdab20860b --- /dev/null +++ b/queue-3.18/extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch @@ -0,0 +1,38 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -150,6 +150,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-3.18/gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch b/queue-3.18/gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch new file mode 100644 index 00000000000..ec2984520d1 --- /dev/null +++ b/queue-3.18/gpu-drm-mgag200-mgag200_main-handle-error-from-pci_iomap.patch @@ -0,0 +1,32 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -138,6 +138,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-3.18/igb-close-suspend-race-in-netif_device_detach.patch b/queue-3.18/igb-close-suspend-race-in-netif_device_detach.patch new file mode 100644 index 00000000000..d127015431c --- /dev/null +++ b/queue-3.18/igb-close-suspend-race-in-netif_device_detach.patch @@ -0,0 +1,84 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -3170,7 +3170,9 @@ static int __igb_close(struct net_device + + static int igb_close(struct net_device *netdev) + { +- return __igb_close(netdev, false); ++ if (netif_device_present(netdev)) ++ return __igb_close(netdev, false); ++ return 0; + } + + /** +@@ -7328,12 +7330,14 @@ static int __igb_shutdown(struct pci_dev + int retval = 0; + #endif + ++ rtnl_lock(); + netif_device_detach(netdev); + + if (netif_running(netdev)) + __igb_close(netdev, true); + + igb_clear_interrupt_scheme(adapter); ++ rtnl_unlock(); + + #ifdef CONFIG_PM + retval = pci_save_state(pdev); +@@ -7452,16 +7456,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; + } + + #ifdef CONFIG_PM_RUNTIME diff --git a/queue-3.18/igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch b/queue-3.18/igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch new file mode 100644 index 00000000000..5ee989b5f0a --- /dev/null +++ b/queue-3.18/igb-fix-hw_dbg-logging-in-igb_update_flash_i210.patch @@ -0,0 +1,37 @@ +From foo@baz Sun Nov 19 12:16:40 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-3.18/igb-reset-the-phy-before-reading-the-phy-id.patch b/queue-3.18/igb-reset-the-phy-before-reading-the-phy-id.patch new file mode 100644 index 00000000000..9943f87ce33 --- /dev/null +++ b/queue-3.18/igb-reset-the-phy-before-reading-the-phy-id.patch @@ -0,0 +1,72 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -215,6 +215,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. */ + ret_val = igb_get_phy_id_82575(hw); + if (ret_val) diff --git a/queue-3.18/iscsi-target-fix-iscsi_np-reset-hung-task-during-parallel-delete.patch b/queue-3.18/iscsi-target-fix-iscsi_np-reset-hung-task-during-parallel-delete.patch new file mode 100644 index 00000000000..8a07657e7dc --- /dev/null +++ b/queue-3.18/iscsi-target-fix-iscsi_np-reset-hung-task-during-parallel-delete.patch @@ -0,0 +1,123 @@ +From 978d13d60c34818a41fc35962602bdfa5c03f214 Mon Sep 17 00:00:00 2001 +From: Nicholas Bellinger +Date: Fri, 4 Aug 2017 23:59:31 -0700 +Subject: iscsi-target: Fix iscsi_np reset hung task during parallel delete + +From: Nicholas Bellinger + +commit 978d13d60c34818a41fc35962602bdfa5c03f214 upstream. + +This patch fixes a bug associated with iscsit_reset_np_thread() +that can occur during parallel configfs rmdir of a single iscsi_np +used across multiple iscsi-target instances, that would result in +hung task(s) similar to below where configfs rmdir process context +was blocked indefinately waiting for iscsi_np->np_restart_comp +to finish: + +[ 6726.112076] INFO: task dcp_proxy_node_:15550 blocked for more than 120 seconds. +[ 6726.119440] Tainted: G W O 4.1.26-3321 #2 +[ 6726.125045] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. +[ 6726.132927] dcp_proxy_node_ D ffff8803f202bc88 0 15550 1 0x00000000 +[ 6726.140058] ffff8803f202bc88 ffff88085c64d960 ffff88083b3b1ad0 ffff88087fffeb08 +[ 6726.147593] ffff8803f202c000 7fffffffffffffff ffff88083f459c28 ffff88083b3b1ad0 +[ 6726.155132] ffff88035373c100 ffff8803f202bca8 ffffffff8168ced2 ffff8803f202bcb8 +[ 6726.162667] Call Trace: +[ 6726.165150] [] schedule+0x32/0x80 +[ 6726.170156] [] schedule_timeout+0x214/0x290 +[ 6726.176030] [] ? __send_signal+0x52/0x4a0 +[ 6726.181728] [] wait_for_completion+0x96/0x100 +[ 6726.187774] [] ? wake_up_state+0x10/0x10 +[ 6726.193395] [] iscsit_reset_np_thread+0x62/0xe0 [iscsi_target_mod] +[ 6726.201278] [] iscsit_tpg_disable_portal_group+0x96/0x190 [iscsi_target_mod] +[ 6726.210033] [] lio_target_tpg_store_enable+0x4f/0xc0 [iscsi_target_mod] +[ 6726.218351] [] configfs_write_file+0xaa/0x110 +[ 6726.224392] [] vfs_write+0xa4/0x1b0 +[ 6726.229576] [] SyS_write+0x41/0xb0 +[ 6726.234659] [] system_call_fastpath+0x12/0x71 + +It would happen because each iscsit_reset_np_thread() sets state +to ISCSI_NP_THREAD_RESET, sends SIGINT, and then blocks waiting +for completion on iscsi_np->np_restart_comp. + +However, if iscsi_np was active processing a login request and +more than a single iscsit_reset_np_thread() caller to the same +iscsi_np was blocked on iscsi_np->np_restart_comp, iscsi_np +kthread process context in __iscsi_target_login_thread() would +flush pending signals and only perform a single completion of +np->np_restart_comp before going back to sleep within transport +specific iscsit_transport->iscsi_accept_np code. + +To address this bug, add a iscsi_np->np_reset_count and update +__iscsi_target_login_thread() to keep completing np->np_restart_comp +until ->np_reset_count has reached zero. + +Reported-by: Gary Guo +Tested-by: Gary Guo +Cc: Mike Christie +Cc: Hannes Reinecke +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/target/iscsi/iscsi_target.c | 1 + + drivers/target/iscsi/iscsi_target_core.h | 1 + + drivers/target/iscsi/iscsi_target_login.c | 7 +++++-- + include/target/iscsi/iscsi_target_core.h | 1 + + 4 files changed, 8 insertions(+), 2 deletions(-) + +--- a/drivers/target/iscsi/iscsi_target.c ++++ b/drivers/target/iscsi/iscsi_target.c +@@ -428,6 +428,7 @@ int iscsit_reset_np_thread( + return 0; + } + np->np_thread_state = ISCSI_NP_THREAD_RESET; ++ atomic_inc(&np->np_reset_count); + + if (np->np_thread) { + spin_unlock_bh(&np->np_thread_lock); +--- a/drivers/target/iscsi/iscsi_target_core.h ++++ b/drivers/target/iscsi/iscsi_target_core.h +@@ -783,6 +783,7 @@ struct iscsi_np { + int np_sock_type; + enum np_thread_state_table np_thread_state; + bool enabled; ++ atomic_t np_reset_count; + enum iscsi_timer_flags_table np_login_timer_flags; + u32 np_exports; + enum np_flags_table np_flags; +--- a/drivers/target/iscsi/iscsi_target_login.c ++++ b/drivers/target/iscsi/iscsi_target_login.c +@@ -1275,9 +1275,11 @@ static int __iscsi_target_login_thread(s + flush_signals(current); + + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { + np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; ++ spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); ++ return 1; + } else if (np->np_thread_state == ISCSI_NP_THREAD_SHUTDOWN) { + spin_unlock_bh(&np->np_thread_lock); + goto exit; +@@ -1310,7 +1312,8 @@ static int __iscsi_target_login_thread(s + goto exit; + } else if (rc < 0) { + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { ++ np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; + spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); + iscsit_put_transport(conn->conn_transport); +--- a/include/target/iscsi/iscsi_target_core.h ++++ b/include/target/iscsi/iscsi_target_core.h +@@ -784,6 +784,7 @@ struct iscsi_np { + int np_sock_type; + enum np_thread_state_table np_thread_state; + bool enabled; ++ atomic_t np_reset_count; + enum iscsi_timer_flags_table np_login_timer_flags; + u32 np_exports; + enum np_flags_table np_flags; diff --git a/queue-3.18/ixgbe-fix-aer-error-handling.patch b/queue-3.18/ixgbe-fix-aer-error-handling.patch new file mode 100644 index 00000000000..1ca268ac33c --- /dev/null +++ b/queue-3.18/ixgbe-fix-aer-error-handling.patch @@ -0,0 +1,52 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -8575,7 +8575,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); +@@ -8645,10 +8645,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-3.18/ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch b/queue-3.18/ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch new file mode 100644 index 00000000000..c79a40942d0 --- /dev/null +++ b/queue-3.18/ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch @@ -0,0 +1,78 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -5560,7 +5560,8 @@ static int ixgbe_close(struct net_device + + ixgbe_ptp_stop(adapter); + +- ixgbe_close_suspend(adapter); ++ if (netif_device_present(netdev)) ++ ixgbe_close_suspend(adapter); + + ixgbe_fdir_filter_exit(adapter); + +@@ -5605,14 +5606,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 */ + +@@ -5627,14 +5626,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-3.18/mips-end-asm-function-prologue-macros-with-.insn.patch b/queue-3.18/mips-end-asm-function-prologue-macros-with-.insn.patch new file mode 100644 index 00000000000..0be8d4551c0 --- /dev/null +++ b/queue-3.18/mips-end-asm-function-prologue-macros-with-.insn.patch @@ -0,0 +1,76 @@ +From foo@baz Sun Nov 19 12:16:40 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-3.18/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch b/queue-3.18/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch new file mode 100644 index 00000000000..752860627b8 --- /dev/null +++ b/queue-3.18/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch @@ -0,0 +1,41 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -427,6 +427,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-3.18/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch b/queue-3.18/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch new file mode 100644 index 00000000000..70f0d415c2a --- /dev/null +++ b/queue-3.18/mips-netlogic-exclude-netlogic-xlp-pic-code-from-xlr-builds.patch @@ -0,0 +1,63 @@ +From foo@baz Sun Nov 19 12:16:40 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-3.18/revert-crypto-xts-add-ecb-dependency.patch b/queue-3.18/revert-crypto-xts-add-ecb-dependency.patch new file mode 100644 index 00000000000..91d8d6e40a9 --- /dev/null +++ b/queue-3.18/revert-crypto-xts-add-ecb-dependency.patch @@ -0,0 +1,29 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -290,7 +290,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-3.18/revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch b/queue-3.18/revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch new file mode 100644 index 00000000000..323c070360f --- /dev/null +++ b/queue-3.18/revert-uapi-fix-linux-rds.h-userspace-compilation-errors.patch @@ -0,0 +1,41 @@ +From foo@baz Sun Nov 19 12:16:40 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 + +@@ -214,7 +213,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-3.18/scsi-lpfc-add-missing-memory-barrier.patch b/queue-3.18/scsi-lpfc-add-missing-memory-barrier.patch new file mode 100644 index 00000000000..9451f7dffe2 --- /dev/null +++ b/queue-3.18/scsi-lpfc-add-missing-memory-barrier.patch @@ -0,0 +1,39 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -118,6 +118,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-3.18/scsi-lpfc-correct-host-name-in-symbolic_name-field.patch b/queue-3.18/scsi-lpfc-correct-host-name-in-symbolic_name-field.patch new file mode 100644 index 00000000000..ce61c031577 --- /dev/null +++ b/queue-3.18/scsi-lpfc-correct-host-name-in-symbolic_name-field.patch @@ -0,0 +1,62 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -5137,6 +5137,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. + **/ +@@ -5670,6 +5683,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 */ +@@ -5737,6 +5752,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-3.18/scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch b/queue-3.18/scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch new file mode 100644 index 00000000000..b221d750f8a --- /dev/null +++ b/queue-3.18/scsi-lpfc-correct-issue-leading-to-oops-during-link-reset.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -9774,6 +9774,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-3.18/scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch b/queue-3.18/scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch new file mode 100644 index 00000000000..91cf55f61c6 --- /dev/null +++ b/queue-3.18/scsi-lpfc-fcoe-vport-enable-disable-does-not-bring-up-the-vport.patch @@ -0,0 +1,47 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -528,6 +528,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); + +@@ -548,6 +554,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-3.18/series b/queue-3.18/series index 5f150f2e19f..107b9659273 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -1,2 +1,32 @@ media-imon-fix-null-ptr-deref-in-imon_probe.patch media-dib0700-fix-invalid-dvb_detach-argument.patch +iscsi-target-fix-iscsi_np-reset-hung-task-during-parallel-delete.patch +extcon-palmas-check-the-parent-instance-to-prevent-the-null.patch +arm-omap2-fix-init-for-multiple-quirks-for-the-same-soc.patch +arm-dts-fix-omap3-off-mode-pull-defines.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 +staging-rtl8188eu-fix-incorrect-error-tags-from-logs.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 +alsa-vx-don-t-try-to-update-capture-stream-before-running.patch +alsa-vx-fix-possible-transfer-overflow.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 +ixgbe-fix-aer-error-handling.patch +ixgbe-handle-close-suspend-race-with-netif_device_detach-present.patch +mips-end-asm-function-prologue-macros-with-.insn.patch +mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.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 diff --git a/queue-3.18/staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch b/queue-3.18/staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch new file mode 100644 index 00000000000..28fbff475b8 --- /dev/null +++ b/queue-3.18/staging-rtl8188eu-fix-incorrect-error-tags-from-logs.patch @@ -0,0 +1,49 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -75,7 +75,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-3.18/uapi-fix-linux-rds.h-userspace-compilation-error.patch b/queue-3.18/uapi-fix-linux-rds.h-userspace-compilation-error.patch new file mode 100644 index 00000000000..b5427b70529 --- /dev/null +++ b/queue-3.18/uapi-fix-linux-rds.h-userspace-compilation-error.patch @@ -0,0 +1,45 @@ +From foo@baz Sun Nov 19 12:16:40 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 + +@@ -213,7 +214,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-3.18/uapi-fix-linux-rds.h-userspace-compilation-errors.patch b/queue-3.18/uapi-fix-linux-rds.h-userspace-compilation-errors.patch new file mode 100644 index 00000000000..64cc6cf3824 --- /dev/null +++ b/queue-3.18/uapi-fix-linux-rds.h-userspace-compilation-errors.patch @@ -0,0 +1,319 @@ +From foo@baz Sun Nov 19 12:16:40 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 +@@ -94,8 +94,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 +@@ -105,35 +105,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 { +@@ -141,25 +141,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; + }; + + /* +@@ -200,70 +200,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