From: Sasha Levin Date: Sat, 23 Feb 2019 21:02:55 +0000 (-0500) Subject: patches for 3.18 X-Git-Tag: v4.9.161~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=450e1f605c99175695391d88e3ea091954c912b8;p=thirdparty%2Fkernel%2Fstable-queue.git patches for 3.18 Signed-off-by: Sasha Levin --- diff --git a/queue-3.18/atm-he-fix-sign-extension-overflow-on-large-shift.patch b/queue-3.18/atm-he-fix-sign-extension-overflow-on-large-shift.patch new file mode 100644 index 00000000000..016f386ace8 --- /dev/null +++ b/queue-3.18/atm-he-fix-sign-extension-overflow-on-large-shift.patch @@ -0,0 +1,38 @@ +From eb770d401c7f3410a79f7acb410181e39f21314e Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Tue, 15 Jan 2019 18:03:38 +0000 +Subject: atm: he: fix sign-extension overflow on large shift + +[ Upstream commit cb12d72b27a6f41325ae23a11033cf5fedfa1b97 ] + +Shifting the 1 by exp by an int can lead to sign-extension overlow when +exp is 31 since 1 is an signed int and sign-extending this result to an +unsigned long long will set the upper 32 bits. Fix this by shifting an +unsigned long. + +Detected by cppcheck: +(warning) Shifting signed 32-bit value by 31 bits is undefined behaviour + +Signed-off-by: Colin Ian King +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/atm/he.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/atm/he.c b/drivers/atm/he.c +index c39702bc279d4..937f54ccbe6b5 100644 +--- a/drivers/atm/he.c ++++ b/drivers/atm/he.c +@@ -717,7 +717,7 @@ static int he_init_cs_block_rcm(struct he_dev *he_dev) + instead of '/ 512', use '>> 9' to prevent a call + to divdu3 on x86 platforms + */ +- rate_cps = (unsigned long long) (1 << exp) * (man + 512) >> 9; ++ rate_cps = (unsigned long long) (1UL << exp) * (man + 512) >> 9; + + if (rate_cps < 10) + rate_cps = 10; /* 2.2.1 minimum payload rate is 10 cps */ +-- +2.19.1 + diff --git a/queue-3.18/isdn-avm-fix-string-plus-integer-warning-from-clang.patch b/queue-3.18/isdn-avm-fix-string-plus-integer-warning-from-clang.patch new file mode 100644 index 00000000000..af15275970b --- /dev/null +++ b/queue-3.18/isdn-avm-fix-string-plus-integer-warning-from-clang.patch @@ -0,0 +1,48 @@ +From b6e64c1a03f3138208ed71e534e535d31e56f8b1 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 9 Jan 2019 22:41:08 -0700 +Subject: isdn: avm: Fix string plus integer warning from Clang + +[ Upstream commit 7afa81c55fca0cad589722cb4bce698b4803b0e1 ] + +A recent commit in Clang expanded the -Wstring-plus-int warning, showing +some odd behavior in this file. + +drivers/isdn/hardware/avm/b1.c:426:30: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] + cinfo->version[j] = "\0\0" + 1; + ~~~~~~~^~~ +drivers/isdn/hardware/avm/b1.c:426:30: note: use array indexing to silence this warning + cinfo->version[j] = "\0\0" + 1; + ^ + & [ ] +1 warning generated. + +This is equivalent to just "\0". Nick pointed out that it is smarter to +use "" instead of "\0" because "" is used elsewhere in the kernel and +can be deduplicated at the linking stage. + +Link: https://github.com/ClangBuiltLinux/linux/issues/309 +Suggested-by: Nick Desaulniers +Signed-off-by: Nathan Chancellor +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/isdn/hardware/avm/b1.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c +index 4d9b195547c5c..df2a10157720a 100644 +--- a/drivers/isdn/hardware/avm/b1.c ++++ b/drivers/isdn/hardware/avm/b1.c +@@ -423,7 +423,7 @@ void b1_parse_version(avmctrl_info *cinfo) + int i, j; + + for (j = 0; j < AVM_MAXVERSION; j++) +- cinfo->version[j] = "\0\0" + 1; ++ cinfo->version[j] = ""; + for (i = 0, j = 0; + j < AVM_MAXVERSION && i < cinfo->versionlen; + j++, i += cinfo->versionbuf[i] + 1) +-- +2.19.1 + diff --git a/queue-3.18/isdn-i4l-isdn_tty-fix-some-concurrency-double-free-b.patch b/queue-3.18/isdn-i4l-isdn_tty-fix-some-concurrency-double-free-b.patch new file mode 100644 index 00000000000..8ee4d16cd43 --- /dev/null +++ b/queue-3.18/isdn-i4l-isdn_tty-fix-some-concurrency-double-free-b.patch @@ -0,0 +1,67 @@ +From 943ec3d6b896bce5fb59155cd856c5620bf5df65 Mon Sep 17 00:00:00 2001 +From: Jia-Ju Bai +Date: Tue, 8 Jan 2019 21:04:48 +0800 +Subject: isdn: i4l: isdn_tty: Fix some concurrency double-free bugs + +[ Upstream commit 2ff33d6637393fe9348357285931811b76e1402f ] + +The functions isdn_tty_tiocmset() and isdn_tty_set_termios() may be +concurrently executed. + +isdn_tty_tiocmset + isdn_tty_modem_hup + line 719: kfree(info->dtmf_state); + line 721: kfree(info->silence_state); + line 723: kfree(info->adpcms); + line 725: kfree(info->adpcmr); + +isdn_tty_set_termios + isdn_tty_modem_hup + line 719: kfree(info->dtmf_state); + line 721: kfree(info->silence_state); + line 723: kfree(info->adpcms); + line 725: kfree(info->adpcmr); + +Thus, some concurrency double-free bugs may occur. + +These possible bugs are found by a static tool written by myself and +my manual code review. + +To fix these possible bugs, the mutex lock "modem_info_mutex" used in +isdn_tty_tiocmset() is added in isdn_tty_set_termios(). + +Signed-off-by: Jia-Ju Bai +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/isdn/i4l/isdn_tty.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c +index bc912611fe097..b166354b80428 100644 +--- a/drivers/isdn/i4l/isdn_tty.c ++++ b/drivers/isdn/i4l/isdn_tty.c +@@ -1459,15 +1459,19 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) + { + modem_info *info = (modem_info *) tty->driver_data; + ++ mutex_lock(&modem_info_mutex); + if (!old_termios) + isdn_tty_change_speed(info); + else { + if (tty->termios.c_cflag == old_termios->c_cflag && + tty->termios.c_ispeed == old_termios->c_ispeed && +- tty->termios.c_ospeed == old_termios->c_ospeed) ++ tty->termios.c_ospeed == old_termios->c_ospeed) { ++ mutex_unlock(&modem_info_mutex); + return; ++ } + isdn_tty_change_speed(info); + } ++ mutex_unlock(&modem_info_mutex); + } + + /* +-- +2.19.1 + diff --git a/queue-3.18/leds-lp5523-fix-a-missing-check-of-return-value-of-l.patch b/queue-3.18/leds-lp5523-fix-a-missing-check-of-return-value-of-l.patch new file mode 100644 index 00000000000..34496de5d98 --- /dev/null +++ b/queue-3.18/leds-lp5523-fix-a-missing-check-of-return-value-of-l.patch @@ -0,0 +1,38 @@ +From b0d67b2c5642d83bb7fa78251a60abb696ad37ae Mon Sep 17 00:00:00 2001 +From: Kangjie Lu +Date: Tue, 25 Dec 2018 22:18:23 -0600 +Subject: leds: lp5523: fix a missing check of return value of lp55xx_read + +[ Upstream commit 248b57015f35c94d4eae2fdd8c6febf5cd703900 ] + +When lp55xx_read() fails, "status" is an uninitialized variable and thus +may contain random value; using it leads to undefined behaviors. + +The fix inserts a check for the return value of lp55xx_read: if it +fails, returns with its error code. + +Signed-off-by: Kangjie Lu +Signed-off-by: Jacek Anaszewski +Signed-off-by: Sasha Levin +--- + drivers/leds/leds-lp5523.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c +index 9e1716f8098ca..20e43f8b93256 100644 +--- a/drivers/leds/leds-lp5523.c ++++ b/drivers/leds/leds-lp5523.c +@@ -313,7 +313,9 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip) + + /* Let the programs run for couple of ms and check the engine status */ + usleep_range(3000, 6000); +- lp55xx_read(chip, LP5523_REG_STATUS, &status); ++ ret = lp55xx_read(chip, LP5523_REG_STATUS, &status); ++ if (ret) ++ return ret; + status &= LP5523_ENG_STATUS_MASK; + + if (status != LP5523_ENG_STATUS_MASK) { +-- +2.19.1 + diff --git a/queue-3.18/mfd-ab8500-core-return-zero-in-get_register_interrup.patch b/queue-3.18/mfd-ab8500-core-return-zero-in-get_register_interrup.patch new file mode 100644 index 00000000000..53d8d85e1b5 --- /dev/null +++ b/queue-3.18/mfd-ab8500-core-return-zero-in-get_register_interrup.patch @@ -0,0 +1,40 @@ +From 970f283d458762ce2fcdb82bf4318dbb5804493a Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Thu, 25 Oct 2018 15:43:44 +0300 +Subject: mfd: ab8500-core: Return zero in get_register_interruptible() + +[ Upstream commit 10628e3ecf544fa2e4e24f8e112d95c37884dc98 ] + +This function is supposed to return zero on success or negative error +codes on error. Unfortunately, there is a bug so it sometimes returns +non-zero, positive numbers on success. + +I noticed this bug during review and I can't test it. It does appear +that the return is sometimes propogated back to _regmap_read() where all +non-zero returns are treated as failure so this may affect run time. + +Fixes: 47c1697508f2 ("mfd: Align ab8500 with the abx500 interface") +Signed-off-by: Dan Carpenter +Reviewed-by: Linus Walleij +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/mfd/ab8500-core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c +index bde2fc0724103..44ebb84c2e747 100644 +--- a/drivers/mfd/ab8500-core.c ++++ b/drivers/mfd/ab8500-core.c +@@ -259,7 +259,7 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, + mutex_unlock(&ab8500->lock); + dev_vdbg(ab8500->dev, "rd: addr %#x => data %#x\n", addr, ret); + +- return ret; ++ return (ret < 0) ? ret : 0; + } + + static int ab8500_get_register(struct device *dev, u8 bank, +-- +2.19.1 + diff --git a/queue-3.18/mfd-db8500-prcmu-fix-some-section-annotations.patch b/queue-3.18/mfd-db8500-prcmu-fix-some-section-annotations.patch new file mode 100644 index 00000000000..d628c715c60 --- /dev/null +++ b/queue-3.18/mfd-db8500-prcmu-fix-some-section-annotations.patch @@ -0,0 +1,61 @@ +From 71aa5a02c23250370556d5e0733acdcd438bb66f Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 17 Oct 2018 17:56:28 -0700 +Subject: mfd: db8500-prcmu: Fix some section annotations + +[ Upstream commit a3888f62fe66429fad3be7f2ba962e1e08c26fd6 ] + +When building the kernel with Clang, the following section mismatch +warnings appear: + +WARNING: vmlinux.o(.text+0x7239cc): Section mismatch in reference from +the function db8500_prcmu_probe() to the function +.init.text:init_prcm_registers() +The function db8500_prcmu_probe() references +the function __init init_prcm_registers(). +This is often because db8500_prcmu_probe lacks a __init +annotation or the annotation of init_prcm_registers is wrong. + +WARNING: vmlinux.o(.text+0x723e28): Section mismatch in reference from +the function db8500_prcmu_probe() to the function +.init.text:fw_project_name() +The function db8500_prcmu_probe() references +the function __init fw_project_name(). +This is often because db8500_prcmu_probe lacks a __init +annotation or the annotation of fw_project_name is wrong. + +db8500_prcmu_probe should not be marked as __init so remove the __init +annotation from fw_project_name and init_prcm_registers. + +Signed-off-by: Nathan Chancellor +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/mfd/db8500-prcmu.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c +index 193cf168ba84d..40a70e0c4d872 100644 +--- a/drivers/mfd/db8500-prcmu.c ++++ b/drivers/mfd/db8500-prcmu.c +@@ -2616,7 +2616,7 @@ static struct irq_chip prcmu_irq_chip = { + .irq_unmask = prcmu_irq_unmask, + }; + +-static __init char *fw_project_name(u32 project) ++static char *fw_project_name(u32 project) + { + switch (project) { + case PRCMU_FW_PROJECT_U8500: +@@ -2765,7 +2765,7 @@ void __init db8500_prcmu_early_init(u32 phy_base, u32 size) + INIT_WORK(&mb0_transfer.mask_work, prcmu_mask_work); + } + +-static void __init init_prcm_registers(void) ++static void init_prcm_registers(void) + { + u32 val; + +-- +2.19.1 + diff --git a/queue-3.18/mfd-mc13xxx-fix-a-missing-check-of-a-register-read-f.patch b/queue-3.18/mfd-mc13xxx-fix-a-missing-check-of-a-register-read-f.patch new file mode 100644 index 00000000000..ae548d52342 --- /dev/null +++ b/queue-3.18/mfd-mc13xxx-fix-a-missing-check-of-a-register-read-f.patch @@ -0,0 +1,38 @@ +From dd00fe53562476fba79c6505b433b21d685317d6 Mon Sep 17 00:00:00 2001 +From: Kangjie Lu +Date: Thu, 20 Dec 2018 15:12:11 -0600 +Subject: mfd: mc13xxx: Fix a missing check of a register-read failure + +[ Upstream commit 9e28989d41c0eab57ec0bb156617a8757406ff8a ] + +When mc13xxx_reg_read() fails, "old_adc0" is uninitialized and will +contain random value. Further execution uses "old_adc0" even when +mc13xxx_reg_read() fails. +The fix checks the return value of mc13xxx_reg_read(), and exits +the execution when it fails. + +Signed-off-by: Kangjie Lu +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/mfd/mc13xxx-core.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c +index 64dde5d24b320..b5c8e5fe6af6d 100644 +--- a/drivers/mfd/mc13xxx-core.c ++++ b/drivers/mfd/mc13xxx-core.c +@@ -274,7 +274,9 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, + + mc13xxx->adcflags |= MC13XXX_ADC_WORKING; + +- mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0); ++ ret = mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0); ++ if (ret) ++ goto out; + + adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2; + adc1 = MC13XXX_ADC1_ADEN | MC13XXX_ADC1_ADTRIGIGN | MC13XXX_ADC1_ASC; +-- +2.19.1 + diff --git a/queue-3.18/mfd-ti_am335x_tscadc-use-platform_devid_auto-while-r.patch b/queue-3.18/mfd-ti_am335x_tscadc-use-platform_devid_auto-while-r.patch new file mode 100644 index 00000000000..1611c4c0619 --- /dev/null +++ b/queue-3.18/mfd-ti_am335x_tscadc-use-platform_devid_auto-while-r.patch @@ -0,0 +1,38 @@ +From 07fd1b71e18987a9a7e72b0e16ce71f706642541 Mon Sep 17 00:00:00 2001 +From: Vignesh R +Date: Mon, 3 Dec 2018 13:31:17 +0530 +Subject: mfd: ti_am335x_tscadc: Use PLATFORM_DEVID_AUTO while registering mfd + cells + +[ Upstream commit b40ee006fe6a8a25093434e5d394128c356a48f3 ] + +Use PLATFORM_DEVID_AUTO to number mfd cells while registering, so that +different instances are uniquely identified. This is required in order +to support registering of multiple instances of same ti_am335x_tscadc IP. + +Signed-off-by: Vignesh R +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/mfd/ti_am335x_tscadc.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c +index 5726bf4e6c61f..e8d5d171ab048 100644 +--- a/drivers/mfd/ti_am335x_tscadc.c ++++ b/drivers/mfd/ti_am335x_tscadc.c +@@ -282,8 +282,9 @@ static int ti_tscadc_probe(struct platform_device *pdev) + cell->pdata_size = sizeof(tscadc); + } + +- err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells, +- tscadc->used_cells, NULL, 0, NULL); ++ err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, ++ tscadc->cells, tscadc->used_cells, NULL, ++ 0, NULL); + if (err < 0) + goto err_disable_clk; + +-- +2.19.1 + diff --git a/queue-3.18/mfd-twl-core-fix-section-annotations-on-un-protect_p.patch b/queue-3.18/mfd-twl-core-fix-section-annotations-on-un-protect_p.patch new file mode 100644 index 00000000000..f9336eb4e88 --- /dev/null +++ b/queue-3.18/mfd-twl-core-fix-section-annotations-on-un-protect_p.patch @@ -0,0 +1,53 @@ +From 50bdd721cb4a1564585c3184793f373520d4a70f Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 17 Oct 2018 10:13:23 -0700 +Subject: mfd: twl-core: Fix section annotations on {,un}protect_pm_master + +[ Upstream commit 8838555089f0345b87f4277fe5a8dd647dc65589 ] + +When building the kernel with Clang, the following section mismatch +warning appears: + +WARNING: vmlinux.o(.text+0x3d84a3b): Section mismatch in reference from +the function twl_probe() to the function +.init.text:unprotect_pm_master() +The function twl_probe() references +the function __init unprotect_pm_master(). +This is often because twl_probe lacks a __init +annotation or the annotation of unprotect_pm_master is wrong. + +Remove the __init annotation on the *protect_pm_master functions so +there is no more mismatch. + +Signed-off-by: Nathan Chancellor +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/mfd/twl-core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c +index db11b4f406116..2608c1d865857 100644 +--- a/drivers/mfd/twl-core.c ++++ b/drivers/mfd/twl-core.c +@@ -983,7 +983,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned irq_base, + * letting it generate the right frequencies for USB, MADC, and + * other purposes. + */ +-static inline int __init protect_pm_master(void) ++static inline int protect_pm_master(void) + { + int e = 0; + +@@ -992,7 +992,7 @@ static inline int __init protect_pm_master(void) + return e; + } + +-static inline int __init unprotect_pm_master(void) ++static inline int unprotect_pm_master(void) + { + int e = 0; + +-- +2.19.1 + diff --git a/queue-3.18/mfd-wm5110-add-missing-asrc-rate-register.patch b/queue-3.18/mfd-wm5110-add-missing-asrc-rate-register.patch new file mode 100644 index 00000000000..6d342fcdc9b --- /dev/null +++ b/queue-3.18/mfd-wm5110-add-missing-asrc-rate-register.patch @@ -0,0 +1,37 @@ +From d78d06169dbd226507fe2c9c07b952ae3eb438fd Mon Sep 17 00:00:00 2001 +From: Charles Keepax +Date: Wed, 28 Nov 2018 10:04:22 +0000 +Subject: mfd: wm5110: Add missing ASRC rate register + +[ Upstream commit 04c801c18ded421845324255e660147a6f58dcd6 ] + +Signed-off-by: Charles Keepax +Signed-off-by: Lee Jones +Signed-off-by: Sasha Levin +--- + drivers/mfd/wm5110-tables.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c +index 6ccc0fdab767f..85eccd796a856 100644 +--- a/drivers/mfd/wm5110-tables.c ++++ b/drivers/mfd/wm5110-tables.c +@@ -1617,6 +1617,7 @@ static const struct reg_default wm5110_reg_default[] = { + { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */ + { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */ + { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */ ++ { 0x00000EE3, 0x4000 }, /* R3811 - ASRC_RATE2 */ + { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */ + { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */ + { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */ +@@ -2684,6 +2685,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) + case ARIZONA_ASRC_ENABLE: + case ARIZONA_ASRC_STATUS: + case ARIZONA_ASRC_RATE1: ++ case ARIZONA_ASRC_RATE2: + case ARIZONA_ISRC_1_CTRL_1: + case ARIZONA_ISRC_1_CTRL_2: + case ARIZONA_ISRC_1_CTRL_3: +-- +2.19.1 + diff --git a/queue-3.18/mips-ath79-enable-of-serial-ports-in-the-default-con.patch b/queue-3.18/mips-ath79-enable-of-serial-ports-in-the-default-con.patch new file mode 100644 index 00000000000..111fd9a558d --- /dev/null +++ b/queue-3.18/mips-ath79-enable-of-serial-ports-in-the-default-con.patch @@ -0,0 +1,37 @@ +From 6be503a2ce440d30faa33ff4a36ec0a6b801f2ac Mon Sep 17 00:00:00 2001 +From: Alban Bedel +Date: Mon, 7 Jan 2019 20:45:15 +0100 +Subject: MIPS: ath79: Enable OF serial ports in the default config + +[ Upstream commit 565dc8a4f55e491935bfb04866068d21784ea9a4 ] + +CONFIG_SERIAL_OF_PLATFORM is needed to get a working console on the OF +boards, enable it in the default config to get a working setup out of +the box. + +Signed-off-by: Alban Bedel +Signed-off-by: Paul Burton +Cc: linux-mips@vger.kernel.org +Cc: Ralf Baechle +Cc: James Hogan +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Sasha Levin +--- + arch/mips/configs/ath79_defconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/mips/configs/ath79_defconfig b/arch/mips/configs/ath79_defconfig +index 134879c1310a0..4ed369c0ec6a1 100644 +--- a/arch/mips/configs/ath79_defconfig ++++ b/arch/mips/configs/ath79_defconfig +@@ -74,6 +74,7 @@ CONFIG_SERIAL_8250_CONSOLE=y + # CONFIG_SERIAL_8250_PCI is not set + CONFIG_SERIAL_8250_NR_UARTS=1 + CONFIG_SERIAL_8250_RUNTIME_UARTS=1 ++CONFIG_SERIAL_OF_PLATFORM=y + CONFIG_SERIAL_AR933X=y + CONFIG_SERIAL_AR933X_CONSOLE=y + # CONFIG_HW_RANDOM is not set +-- +2.19.1 + diff --git a/queue-3.18/mips-jazz-fix-64bit-build.patch b/queue-3.18/mips-jazz-fix-64bit-build.patch new file mode 100644 index 00000000000..6f4e3828e6c --- /dev/null +++ b/queue-3.18/mips-jazz-fix-64bit-build.patch @@ -0,0 +1,75 @@ +From d41ab11275813d02383d3aca0165ecbba4e1cd1a Mon Sep 17 00:00:00 2001 +From: Thomas Bogendoerfer +Date: Wed, 9 Jan 2019 18:12:16 +0100 +Subject: MIPS: jazz: fix 64bit build + +[ Upstream commit 41af167fbc0032f9d7562854f58114eaa9270336 ] + +64bit JAZZ builds failed with + + linux-next/arch/mips/jazz/jazzdma.c: In function `vdma_init`: + /linux-next/arch/mips/jazz/jazzdma.c:77:30: error: implicit declaration + of function `KSEG1ADDR`; did you mean `CKSEG1ADDR`? + [-Werror=implicit-function-declaration] + pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl); + ^~~~~~~~~ + CKSEG1ADDR + /linux-next/arch/mips/jazz/jazzdma.c:77:10: error: cast to pointer from + integer of different size [-Werror=int-to-pointer-cast] + pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl); + ^ + In file included from /linux-next/arch/mips/include/asm/barrier.h:11:0, + from /linux-next/include/linux/compiler.h:248, + from /linux-next/include/linux/kernel.h:10, + from /linux-next/arch/mips/jazz/jazzdma.c:11: + /linux-next/arch/mips/include/asm/addrspace.h:41:29: error: cast from + pointer to integer of different size [-Werror=pointer-to-int-cast] + #define _ACAST32_ (_ATYPE_)(_ATYPE32_) /* widen if necessary */ + ^ + /linux-next/arch/mips/include/asm/addrspace.h:53:25: note: in + expansion of macro `_ACAST32_` + #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) + ^~~~~~~~~ + /linux-next/arch/mips/jazz/jazzdma.c:84:44: note: in expansion of + macro `CPHYSADDR` + r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl)); + +Using correct casts and CKSEG1ADDR when dealing with the pgtbl setup +fixes this. + +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Paul Burton +Cc: Ralf Baechle +Cc: James Hogan +Cc: linux-mips@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Sasha Levin +--- + arch/mips/jazz/jazzdma.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c +index db6f5afff4ff1..ea897912bc712 100644 +--- a/arch/mips/jazz/jazzdma.c ++++ b/arch/mips/jazz/jazzdma.c +@@ -71,14 +71,15 @@ static int __init vdma_init(void) + get_order(VDMA_PGTBL_SIZE)); + BUG_ON(!pgtbl); + dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE); +- pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl); ++ pgtbl = (VDMA_PGTBL_ENTRY *)CKSEG1ADDR((unsigned long)pgtbl); + + /* + * Clear the R4030 translation table + */ + vdma_pgtbl_init(); + +- r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl)); ++ r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, ++ CPHYSADDR((unsigned long)pgtbl)); + r4030_write_reg32(JAZZ_R4030_TRSTBL_LIM, VDMA_PGTBL_SIZE); + r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0); + +-- +2.19.1 + diff --git a/queue-3.18/scsi-isci-initialize-shost-fully-before-calling-scsi.patch b/queue-3.18/scsi-isci-initialize-shost-fully-before-calling-scsi.patch new file mode 100644 index 00000000000..b72b62c8675 --- /dev/null +++ b/queue-3.18/scsi-isci-initialize-shost-fully-before-calling-scsi.patch @@ -0,0 +1,97 @@ +From 3135e553c4d233e0d494570e726764bba4419fc1 Mon Sep 17 00:00:00 2001 +From: Logan Gunthorpe +Date: Tue, 8 Jan 2019 13:50:43 -0700 +Subject: scsi: isci: initialize shost fully before calling scsi_add_host() + +[ Upstream commit cc29a1b0a3f2597ce887d339222fa85b9307706d ] + +scsi_mq_setup_tags(), which is called by scsi_add_host(), calculates the +command size to allocate based on the prot_capabilities. In the isci +driver, scsi_host_set_prot() is called after scsi_add_host() so the command +size gets calculated to be smaller than it needs to be. Eventually, +scsi_mq_init_request() locates the 'prot_sdb' after the command assuming it +was sized correctly and a buffer overrun may occur. + +However, seeing blk_mq_alloc_rqs() rounds up to the nearest cache line +size, the mistake can go unnoticed. + +The bug was noticed after the struct request size was reduced by commit +9d037ad707ed ("block: remove req->timeout_list") + +Which likely reduced the allocated space for the request by an entire cache +line, enough that the overflow could be hit and it caused a panic, on boot, +at: + + RIP: 0010:t10_pi_complete+0x77/0x1c0 + Call Trace: + + sd_done+0xf5/0x340 + scsi_finish_command+0xc3/0x120 + blk_done_softirq+0x83/0xb0 + __do_softirq+0xa1/0x2e6 + irq_exit+0xbc/0xd0 + call_function_single_interrupt+0xf/0x20 + + +sd_done() would call scsi_prot_sg_count() which reads the number of +entities in 'prot_sdb', but seeing 'prot_sdb' is located after the end of +the allocated space it reads a garbage number and erroneously calls +t10_pi_complete(). + +To prevent this, the calls to scsi_host_set_prot() are moved into +isci_host_alloc() before the call to scsi_add_host(). Out of caution, also +move the similar call to scsi_host_set_guard(). + +Fixes: 3d2d75254915 ("[SCSI] isci: T10 DIF support") +Link: http://lkml.kernel.org/r/da851333-eadd-163a-8c78-e1f4ec5ec857@deltatee.com +Signed-off-by: Logan Gunthorpe +Cc: Intel SCU Linux support +Cc: Artur Paszkiewicz +Cc: "James E.J. Bottomley" +Cc: "Martin K. Petersen" +Cc: Christoph Hellwig +Cc: Jens Axboe +Cc: Jeff Moyer +Reviewed-by: Jeff Moyer +Reviewed-by: Jens Axboe +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/isci/init.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c +index 2e890b1e2526b..05b5747b7d418 100644 +--- a/drivers/scsi/isci/init.c ++++ b/drivers/scsi/isci/init.c +@@ -598,6 +598,13 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id) + shost->max_lun = ~0; + shost->max_cmd_len = MAX_COMMAND_SIZE; + ++ /* turn on DIF support */ ++ scsi_host_set_prot(shost, ++ SHOST_DIF_TYPE1_PROTECTION | ++ SHOST_DIF_TYPE2_PROTECTION | ++ SHOST_DIF_TYPE3_PROTECTION); ++ scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC); ++ + err = scsi_add_host(shost, &pdev->dev); + if (err) + goto err_shost; +@@ -685,13 +692,6 @@ static int isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) + goto err_host_alloc; + } + pci_info->hosts[i] = h; +- +- /* turn on DIF support */ +- scsi_host_set_prot(to_shost(h), +- SHOST_DIF_TYPE1_PROTECTION | +- SHOST_DIF_TYPE2_PROTECTION | +- SHOST_DIF_TYPE3_PROTECTION); +- scsi_host_set_guard(to_shost(h), SHOST_DIX_GUARD_CRC); + } + + err = isci_setup_interrupts(pdev); +-- +2.19.1 + diff --git a/queue-3.18/scsi-qla4xxx-check-return-code-of-qla4xxx_copy_from_.patch b/queue-3.18/scsi-qla4xxx-check-return-code-of-qla4xxx_copy_from_.patch new file mode 100644 index 00000000000..bb9b86eb25d --- /dev/null +++ b/queue-3.18/scsi-qla4xxx-check-return-code-of-qla4xxx_copy_from_.patch @@ -0,0 +1,33 @@ +From d7d9b3d21777090292c3058ff2fb3ad603274e37 Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Thu, 20 Dec 2018 11:16:07 +0800 +Subject: scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param + +[ Upstream commit 72b4a0465f995175a2e22cf4a636bf781f1f28a7 ] + +The return code should be check while qla4xxx_copy_from_fwddb_param fails. + +Signed-off-by: YueHaibing +Acked-by: Manish Rangankar +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla4xxx/ql4_os.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c +index d0cad6fc598e1..a9fac1eb8306a 100644 +--- a/drivers/scsi/qla4xxx/ql4_os.c ++++ b/drivers/scsi/qla4xxx/ql4_os.c +@@ -7251,6 +7251,8 @@ static int qla4xxx_sysfs_ddb_tgt_create(struct scsi_qla_host *ha, + + rc = qla4xxx_copy_from_fwddb_param(fnode_sess, fnode_conn, + fw_ddb_entry); ++ if (rc) ++ goto free_sess; + + ql4_printk(KERN_INFO, ha, "%s: sysfs entry %s created\n", + __func__, fnode_sess->dev.kobj.name); +-- +2.19.1 + diff --git a/queue-3.18/series b/queue-3.18/series index 8d69dab7bf8..fb8fa6d5342 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -1,3 +1,17 @@ ceph-avoid-repeatedly-adding-inode-to-mdsc-snap_flush_list.patch numa-change-get_mempolicy-to-use-nr_node_ids-instead-of-max_numnodes.patch keys-allow-reaching-the-keys-quotas-exactly.patch +mfd-ti_am335x_tscadc-use-platform_devid_auto-while-r.patch +mfd-twl-core-fix-section-annotations-on-un-protect_p.patch +mfd-db8500-prcmu-fix-some-section-annotations.patch +mfd-ab8500-core-return-zero-in-get_register_interrup.patch +mfd-wm5110-add-missing-asrc-rate-register.patch +mfd-mc13xxx-fix-a-missing-check-of-a-register-read-f.patch +mips-ath79-enable-of-serial-ports-in-the-default-con.patch +scsi-qla4xxx-check-return-code-of-qla4xxx_copy_from_.patch +scsi-isci-initialize-shost-fully-before-calling-scsi.patch +mips-jazz-fix-64bit-build.patch +isdn-i4l-isdn_tty-fix-some-concurrency-double-free-b.patch +atm-he-fix-sign-extension-overflow-on-large-shift.patch +leds-lp5523-fix-a-missing-check-of-return-value-of-l.patch +isdn-avm-fix-string-plus-integer-warning-from-clang.patch