From: Greg Kroah-Hartman Date: Tue, 26 Mar 2019 01:22:48 +0000 (+0900) Subject: 4.4-stable patches X-Git-Tag: v4.9.166~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8582e7110744566f656938ddd86a753791c367b9;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: arm64-mm-add-trace_irqflags-annotations-to-do_debug_exception.patch extcon-usb-gpio-don-t-miss-event-during-suspend-resume.patch kbuild-setlocalversion-print-error-to-stderr.patch mm-rmap-replace-bug_on-anon_vma-degree-with-vm_warn_on.patch mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch mmc-core-fix-using-wrong-io-voltage-if-mmc_select_hs200-fails.patch mmc-core-shut-up-voltage-ranges-unspecified-pr_info.patch mmc-debugfs-add-a-restriction-to-mmc-debugfs-clock-setting.patch mmc-make-man_bkops_en-message-a-debug.patch mmc-pwrseq_simple-make-reset-gpios-optional-to-match-doc.patch mmc-sanitize-bus-width-in-debug-output.patch serial-sprd-adjust-timeout-to-a-big-value.patch tcp-dccp-drop-syn-packets-if-accept-queue-is-full.patch usb-dwc3-gadget-fix-suspend-resume-during-device-mode.patch usb-gadget-add-the-gserial-port-checking-in-gs_start_tx.patch usb-gadget-composite-fix-dereference-after-null-check-coverify-warning.patch --- diff --git a/queue-4.4/arm64-mm-add-trace_irqflags-annotations-to-do_debug_exception.patch b/queue-4.4/arm64-mm-add-trace_irqflags-annotations-to-do_debug_exception.patch new file mode 100644 index 00000000000..24e544806ce --- /dev/null +++ b/queue-4.4/arm64-mm-add-trace_irqflags-annotations-to-do_debug_exception.patch @@ -0,0 +1,103 @@ +From 6afedcd23cfd7ac56c011069e4a8db37b46e4623 Mon Sep 17 00:00:00 2001 +From: James Morse +Date: Wed, 13 Apr 2016 13:40:00 +0100 +Subject: arm64: mm: Add trace_irqflags annotations to do_debug_exception() + +From: James Morse + +commit 6afedcd23cfd7ac56c011069e4a8db37b46e4623 upstream. + +With CONFIG_PROVE_LOCKING, CONFIG_DEBUG_LOCKDEP and CONFIG_TRACE_IRQFLAGS +enabled, lockdep will compare current->hardirqs_enabled with the flags from +local_irq_save(). + +When a debug exception occurs, interrupts are disabled in entry.S, but +lockdep isn't told, resulting in: +DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled) +------------[ cut here ]------------ +WARNING: at ../kernel/locking/lockdep.c:3523 +Modules linked in: +CPU: 3 PID: 1752 Comm: perf Not tainted 4.5.0-rc4+ #2204 +Hardware name: ARM Juno development board (r1) (DT) +task: ffffffc974868000 ti: ffffffc975f40000 task.ti: ffffffc975f40000 +PC is at check_flags.part.35+0x17c/0x184 +LR is at check_flags.part.35+0x17c/0x184 +pc : [] lr : [] pstate: 600003c5 +[...] +---[ end trace 74631f9305ef5020 ]--- +Call trace: +[] check_flags.part.35+0x17c/0x184 +[] lock_acquire+0xa8/0xc4 +[] breakpoint_handler+0x118/0x288 +[] do_debug_exception+0x3c/0xa8 +[] el1_dbg+0x18/0x6c +[] do_filp_open+0x64/0xdc +[] do_sys_open+0x140/0x204 +[] SyS_openat+0x10/0x18 +[] el0_svc_naked+0x24/0x28 +possible reason: unannotated irqs-off. +irq event stamp: 65857 +hardirqs last enabled at (65857): [] lookup_mnt+0xf4/0x1b4 +hardirqs last disabled at (65856): [] lookup_mnt+0xbc/0x1b4 +softirqs last enabled at (65790): [] __do_softirq+0x1f8/0x290 +softirqs last disabled at (65757): [] irq_exit+0x9c/0xd0 + +This patch adds the annotations to do_debug_exception(), while trying not +to call trace_hardirqs_off() if el1_dbg() interrupted a task that already +had irqs disabled. + +Signed-off-by: James Morse +Signed-off-by: Will Deacon +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/mm/fault.c | 33 +++++++++++++++++++++++---------- + 1 file changed, 23 insertions(+), 10 deletions(-) + +--- a/arch/arm64/mm/fault.c ++++ b/arch/arm64/mm/fault.c +@@ -595,20 +595,33 @@ asmlinkage int __exception do_debug_exce + { + const struct fault_info *inf = debug_fault_info + DBG_ESR_EVT(esr); + struct siginfo info; ++ int rv; + +- if (!inf->fn(addr, esr, regs)) +- return 1; ++ /* ++ * Tell lockdep we disabled irqs in entry.S. Do nothing if they were ++ * already disabled to preserve the last enabled/disabled addresses. ++ */ ++ if (interrupts_enabled(regs)) ++ trace_hardirqs_off(); + +- pr_alert("Unhandled debug exception: %s (0x%08x) at 0x%016lx\n", +- inf->name, esr, addr); ++ if (!inf->fn(addr, esr, regs)) { ++ rv = 1; ++ } else { ++ pr_alert("Unhandled debug exception: %s (0x%08x) at 0x%016lx\n", ++ inf->name, esr, addr); + +- info.si_signo = inf->sig; +- info.si_errno = 0; +- info.si_code = inf->code; +- info.si_addr = (void __user *)addr; +- arm64_notify_die("", regs, &info, 0); ++ info.si_signo = inf->sig; ++ info.si_errno = 0; ++ info.si_code = inf->code; ++ info.si_addr = (void __user *)addr; ++ arm64_notify_die("", regs, &info, 0); ++ rv = 0; ++ } + +- return 0; ++ if (interrupts_enabled(regs)) ++ trace_hardirqs_on(); ++ ++ return rv; + } + + #ifdef CONFIG_ARM64_PAN diff --git a/queue-4.4/extcon-usb-gpio-don-t-miss-event-during-suspend-resume.patch b/queue-4.4/extcon-usb-gpio-don-t-miss-event-during-suspend-resume.patch new file mode 100644 index 00000000000..a597b1fd9ed --- /dev/null +++ b/queue-4.4/extcon-usb-gpio-don-t-miss-event-during-suspend-resume.patch @@ -0,0 +1,35 @@ +From 04c080080855ce84dcd490a2e04805608a21085d Mon Sep 17 00:00:00 2001 +From: Roger Quadros +Date: Mon, 11 Apr 2016 17:04:45 +0300 +Subject: extcon: usb-gpio: Don't miss event during suspend/resume + +From: Roger Quadros + +commit 04c080080855ce84dcd490a2e04805608a21085d upstream. + +Pin state might have changed during suspend/resume while +our interrupts were disabled and if device doesn't support wakeup. + +Scan for change during resume for such case. + +Signed-off-by: Roger Quadros +Signed-off-by: Chanwoo Choi +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/extcon/extcon-usb-gpio.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/extcon/extcon-usb-gpio.c ++++ b/drivers/extcon/extcon-usb-gpio.c +@@ -192,6 +192,9 @@ static int usb_extcon_resume(struct devi + } + + enable_irq(info->id_irq); ++ if (!device_may_wakeup(dev)) ++ queue_delayed_work(system_power_efficient_wq, ++ &info->wq_detcable, 0); + + return ret; + } diff --git a/queue-4.4/kbuild-setlocalversion-print-error-to-stderr.patch b/queue-4.4/kbuild-setlocalversion-print-error-to-stderr.patch new file mode 100644 index 00000000000..b7f536a3e22 --- /dev/null +++ b/queue-4.4/kbuild-setlocalversion-print-error-to-stderr.patch @@ -0,0 +1,40 @@ +From 78283edf2c01c38eb840a3de5ffd18fe2992ab64 Mon Sep 17 00:00:00 2001 +From: Wolfram Sang +Date: Mon, 6 Jun 2016 21:00:38 +0200 +Subject: kbuild: setlocalversion: print error to STDERR + +From: Wolfram Sang + +commit 78283edf2c01c38eb840a3de5ffd18fe2992ab64 upstream. + +I tried to use 'make O=...' from an unclean source tree. This triggered +the error path of setlocalversion. But by printing to STDOUT, it created +a broken localversion which then caused another (unrelated) error: + +"4.7.0-rc2Error: kernelrelease not valid - run make prepare to update it" exceeds 64 characters + +After printing to STDERR, the true build error gets displayed later: + + /home/wsa/Kernel/linux is not clean, please run 'make mrproper' + in the '/home/wsa/Kernel/linux' directory. + +Signed-off-by: Wolfram Sang +Signed-off-by: Michal Marek +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/setlocalversion | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/setlocalversion ++++ b/scripts/setlocalversion +@@ -143,7 +143,7 @@ fi + if test -e include/config/auto.conf; then + . include/config/auto.conf + else +- echo "Error: kernelrelease not valid - run 'make prepare' to update it" ++ echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2 + exit 1 + fi + diff --git a/queue-4.4/mm-rmap-replace-bug_on-anon_vma-degree-with-vm_warn_on.patch b/queue-4.4/mm-rmap-replace-bug_on-anon_vma-degree-with-vm_warn_on.patch new file mode 100644 index 00000000000..316a1537e8e --- /dev/null +++ b/queue-4.4/mm-rmap-replace-bug_on-anon_vma-degree-with-vm_warn_on.patch @@ -0,0 +1,37 @@ +From e4c5800a3991f0c6a766983535dfc10d51802cf6 Mon Sep 17 00:00:00 2001 +From: Konstantin Khlebnikov +Date: Thu, 19 May 2016 17:11:46 -0700 +Subject: mm/rmap: replace BUG_ON(anon_vma->degree) with VM_WARN_ON + +From: Konstantin Khlebnikov + +commit e4c5800a3991f0c6a766983535dfc10d51802cf6 upstream. + +This check effectively catches anon vma hierarchy inconsistence and some +vma corruptions. It was effective for catching corner cases in anon vma +reusing logic. For now this code seems stable so check could be hidden +under CONFIG_DEBUG_VM and replaced with WARN because it's not so fatal. + +Signed-off-by: Konstantin Khlebnikov +Suggested-by: Vasily Averin +Acked-by: Vlastimil Babka +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + mm/rmap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/rmap.c ++++ b/mm/rmap.c +@@ -408,7 +408,7 @@ void unlink_anon_vmas(struct vm_area_str + list_for_each_entry_safe(avc, next, &vma->anon_vma_chain, same_vma) { + struct anon_vma *anon_vma = avc->anon_vma; + +- BUG_ON(anon_vma->degree); ++ VM_WARN_ON(anon_vma->degree); + put_anon_vma(anon_vma); + + list_del(&avc->same_vma); diff --git a/queue-4.4/mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch b/queue-4.4/mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch new file mode 100644 index 00000000000..f066925c9ec --- /dev/null +++ b/queue-4.4/mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch @@ -0,0 +1,35 @@ +From 1712c9373f98ae8ed41599a8d7841a6fba29c264 Mon Sep 17 00:00:00 2001 +From: Ziyuan Xu +Date: Wed, 21 Sep 2016 09:43:49 +0800 +Subject: mmc: core: don't try to switch block size for dual rate mode + +From: Ziyuan Xu + +commit 1712c9373f98ae8ed41599a8d7841a6fba29c264 upstream. + +Per spec, block size should always be 512 bytes for dual rate mode, +so any attempts to switch the block size under dual rate mode should +be neglected. + +Signed-off-by: Ziyuan Xu +Signed-off-by: Shawn Lin +Signed-off-by: Ulf Hansson +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/mmc/core/core.c ++++ b/drivers/mmc/core/core.c +@@ -2406,7 +2406,8 @@ int mmc_set_blocklen(struct mmc_card *ca + { + struct mmc_command cmd = {0}; + +- if (mmc_card_blockaddr(card) || mmc_card_ddr52(card)) ++ if (mmc_card_blockaddr(card) || mmc_card_ddr52(card) || ++ mmc_card_hs400(card) || mmc_card_hs400es(card)) + return 0; + + cmd.opcode = MMC_SET_BLOCKLEN; diff --git a/queue-4.4/mmc-core-fix-using-wrong-io-voltage-if-mmc_select_hs200-fails.patch b/queue-4.4/mmc-core-fix-using-wrong-io-voltage-if-mmc_select_hs200-fails.patch new file mode 100644 index 00000000000..259d8aa094a --- /dev/null +++ b/queue-4.4/mmc-core-fix-using-wrong-io-voltage-if-mmc_select_hs200-fails.patch @@ -0,0 +1,68 @@ +From e51534c806609c806d81bfb034f02737461f855c Mon Sep 17 00:00:00 2001 +From: Dong Aisheng +Date: Thu, 21 Apr 2016 00:51:30 +0800 +Subject: mmc: core: fix using wrong io voltage if mmc_select_hs200 fails + +From: Dong Aisheng + +commit e51534c806609c806d81bfb034f02737461f855c upstream. + +Currently MMC core will keep going if HS200/HS timing switch failed +with -EBADMSG error by the assumption that the old timing is still valid. + +However, for mmc_select_hs200 case, the signal voltage may have already +been switched. If the timing switch failed, we should fall back to +the old voltage in case the card is continue run with legacy timing. + +If fall back signal voltage failed, we explicitly report an EIO error +to force retry during the next power cycle. + +Signed-off-by: Dong Aisheng +Signed-off-by: Ulf Hansson +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/mmc.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +--- a/drivers/mmc/core/mmc.c ++++ b/drivers/mmc/core/mmc.c +@@ -1251,10 +1251,11 @@ static int mmc_select_hs200(struct mmc_c + { + struct mmc_host *host = card->host; + bool send_status = true; +- unsigned int old_timing; ++ unsigned int old_timing, old_signal_voltage; + int err = -EINVAL; + u8 val; + ++ old_signal_voltage = host->ios.signal_voltage; + if (card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200_1_2V) + err = __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120); + +@@ -1263,7 +1264,7 @@ static int mmc_select_hs200(struct mmc_c + + /* If fails try again during next card power cycle */ + if (err) +- goto err; ++ return err; + + mmc_select_driver_type(card); + +@@ -1297,9 +1298,14 @@ static int mmc_select_hs200(struct mmc_c + } + } + err: +- if (err) ++ if (err) { ++ /* fall back to the old signal voltage, if fails report error */ ++ if (__mmc_set_signal_voltage(host, old_signal_voltage)) ++ err = -EIO; ++ + pr_err("%s: %s failed, error %d\n", mmc_hostname(card->host), + __func__, err); ++ } + return err; + } + diff --git a/queue-4.4/mmc-core-shut-up-voltage-ranges-unspecified-pr_info.patch b/queue-4.4/mmc-core-shut-up-voltage-ranges-unspecified-pr_info.patch new file mode 100644 index 00000000000..98a5c5ee17d --- /dev/null +++ b/queue-4.4/mmc-core-shut-up-voltage-ranges-unspecified-pr_info.patch @@ -0,0 +1,46 @@ +From 10a16a01d8f72e80f4780e40cf3122f4caffa411 Mon Sep 17 00:00:00 2001 +From: Russell King +Date: Fri, 29 Jan 2016 09:43:50 +0000 +Subject: mmc: core: shut up "voltage-ranges unspecified" pr_info() + +From: Russell King + +commit 10a16a01d8f72e80f4780e40cf3122f4caffa411 upstream. + +Each time a driver such as sdhci-esdhc-imx is probed, we get a info +printk complaining that the DT voltage-ranges property has not been +specified. + +However, the DT binding specifically says that the voltage-ranges +property is optional. That means we should not be complaining that +DT hasn't specified this property: by indicating that it's optional, +it is valid not to have the property in DT. + +Silence the warning if the property is missing. + +Signed-off-by: Russell King +Signed-off-by: Ulf Hansson +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/core.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/mmc/core/core.c ++++ b/drivers/mmc/core/core.c +@@ -1220,8 +1220,12 @@ int mmc_of_parse_voltage(struct device_n + + voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges); + num_ranges = num_ranges / sizeof(*voltage_ranges) / 2; +- if (!voltage_ranges || !num_ranges) { +- pr_info("%s: voltage-ranges unspecified\n", np->full_name); ++ if (!voltage_ranges) { ++ pr_debug("%s: voltage-ranges unspecified\n", np->full_name); ++ return -EINVAL; ++ } ++ if (!num_ranges) { ++ pr_err("%s: voltage-ranges empty\n", np->full_name); + return -EINVAL; + } + diff --git a/queue-4.4/mmc-debugfs-add-a-restriction-to-mmc-debugfs-clock-setting.patch b/queue-4.4/mmc-debugfs-add-a-restriction-to-mmc-debugfs-clock-setting.patch new file mode 100644 index 00000000000..7bcee147fa1 --- /dev/null +++ b/queue-4.4/mmc-debugfs-add-a-restriction-to-mmc-debugfs-clock-setting.patch @@ -0,0 +1,33 @@ +From e5905ff1281f0a0f5c9863c430ac1ed5faaf5707 Mon Sep 17 00:00:00 2001 +From: Chuanxiao Dong +Date: Thu, 21 Jan 2016 13:57:51 +0100 +Subject: mmc: debugfs: Add a restriction to mmc debugfs clock setting + +From: Chuanxiao Dong + +commit e5905ff1281f0a0f5c9863c430ac1ed5faaf5707 upstream. + +Clock frequency values written to an mmc host should not be less than +the minimum clock frequency which the mmc host supports. + +Signed-off-by: Yuan Juntao +Signed-off-by: Pawel Wodkowski +Signed-off-by: Ulf Hansson +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/debugfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mmc/core/debugfs.c ++++ b/drivers/mmc/core/debugfs.c +@@ -220,7 +220,7 @@ static int mmc_clock_opt_set(void *data, + struct mmc_host *host = data; + + /* We need this check due to input value is u64 */ +- if (val > host->f_max) ++ if (val != 0 && (val > host->f_max || val < host->f_min)) + return -EINVAL; + + mmc_claim_host(host); diff --git a/queue-4.4/mmc-make-man_bkops_en-message-a-debug.patch b/queue-4.4/mmc-make-man_bkops_en-message-a-debug.patch new file mode 100644 index 00000000000..43c7571c0f1 --- /dev/null +++ b/queue-4.4/mmc-make-man_bkops_en-message-a-debug.patch @@ -0,0 +1,32 @@ +From 4ec96b4cbde8d5714a4477b5a2562c3dd40bc5fa Mon Sep 17 00:00:00 2001 +From: Wolfram Sang +Date: Mon, 25 Jan 2016 20:18:12 +0100 +Subject: mmc: make MAN_BKOPS_EN message a debug + +From: Wolfram Sang + +commit 4ec96b4cbde8d5714a4477b5a2562c3dd40bc5fa upstream. + +IMO this info is only useful for developers. Most users won't need this +information, since there is not much they can do about it. + +Signed-off-by: Wolfram Sang +Signed-off-by: Ulf Hansson +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/mmc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mmc/core/mmc.c ++++ b/drivers/mmc/core/mmc.c +@@ -508,7 +508,7 @@ static int mmc_decode_ext_csd(struct mmc + card->ext_csd.raw_bkops_status = + ext_csd[EXT_CSD_BKOPS_STATUS]; + if (!card->ext_csd.man_bkops_en) +- pr_info("%s: MAN_BKOPS_EN bit is not set\n", ++ pr_debug("%s: MAN_BKOPS_EN bit is not set\n", + mmc_hostname(card->host)); + } + diff --git a/queue-4.4/mmc-pwrseq_simple-make-reset-gpios-optional-to-match-doc.patch b/queue-4.4/mmc-pwrseq_simple-make-reset-gpios-optional-to-match-doc.patch new file mode 100644 index 00000000000..98db18865d5 --- /dev/null +++ b/queue-4.4/mmc-pwrseq_simple-make-reset-gpios-optional-to-match-doc.patch @@ -0,0 +1,74 @@ +From 64a67d4762ce3ce4c9466eadd152d825fbf84967 Mon Sep 17 00:00:00 2001 +From: Martin Fuzzey +Date: Wed, 20 Jan 2016 16:08:03 +0100 +Subject: mmc: pwrseq_simple: Make reset-gpios optional to match doc + +From: Martin Fuzzey + +commit 64a67d4762ce3ce4c9466eadd152d825fbf84967 upstream. + +The DT binding doc says reset-gpios is an optional property but the code +currently bails out if it is omitted. + +This is a regression since it breaks previously working device trees. +Fix it by restoring the original documented behaviour. + +Fixes: ce037275861e ("mmc: pwrseq_simple: use GPIO descriptors array API") +Tested-by: Tony Lindgren +Signed-off-by: Martin Fuzzey +Signed-off-by: Ulf Hansson +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/pwrseq_simple.c | 22 ++++++++++++++-------- + 1 file changed, 14 insertions(+), 8 deletions(-) + +--- a/drivers/mmc/core/pwrseq_simple.c ++++ b/drivers/mmc/core/pwrseq_simple.c +@@ -29,15 +29,18 @@ struct mmc_pwrseq_simple { + static void mmc_pwrseq_simple_set_gpios_value(struct mmc_pwrseq_simple *pwrseq, + int value) + { +- int i; + struct gpio_descs *reset_gpios = pwrseq->reset_gpios; +- int values[reset_gpios->ndescs]; + +- for (i = 0; i < reset_gpios->ndescs; i++) +- values[i] = value; ++ if (!IS_ERR(reset_gpios)) { ++ int i; ++ int values[reset_gpios->ndescs]; + +- gpiod_set_array_value_cansleep(reset_gpios->ndescs, reset_gpios->desc, +- values); ++ for (i = 0; i < reset_gpios->ndescs; i++) ++ values[i] = value; ++ ++ gpiod_set_array_value_cansleep( ++ reset_gpios->ndescs, reset_gpios->desc, values); ++ } + } + + static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host) +@@ -79,7 +82,8 @@ static void mmc_pwrseq_simple_free(struc + struct mmc_pwrseq_simple *pwrseq = container_of(host->pwrseq, + struct mmc_pwrseq_simple, pwrseq); + +- gpiod_put_array(pwrseq->reset_gpios); ++ if (!IS_ERR(pwrseq->reset_gpios)) ++ gpiod_put_array(pwrseq->reset_gpios); + + if (!IS_ERR(pwrseq->ext_clk)) + clk_put(pwrseq->ext_clk); +@@ -112,7 +116,9 @@ struct mmc_pwrseq *mmc_pwrseq_simple_all + } + + pwrseq->reset_gpios = gpiod_get_array(dev, "reset", GPIOD_OUT_HIGH); +- if (IS_ERR(pwrseq->reset_gpios)) { ++ if (IS_ERR(pwrseq->reset_gpios) && ++ PTR_ERR(pwrseq->reset_gpios) != -ENOENT && ++ PTR_ERR(pwrseq->reset_gpios) != -ENOSYS) { + ret = PTR_ERR(pwrseq->reset_gpios); + goto clk_put; + } diff --git a/queue-4.4/mmc-sanitize-bus-width-in-debug-output.patch b/queue-4.4/mmc-sanitize-bus-width-in-debug-output.patch new file mode 100644 index 00000000000..960dafd45af --- /dev/null +++ b/queue-4.4/mmc-sanitize-bus-width-in-debug-output.patch @@ -0,0 +1,46 @@ +From ed9feec72fc1fa194ebfdb79e14561b35decce63 Mon Sep 17 00:00:00 2001 +From: Wolfram Sang +Date: Fri, 29 Jan 2016 09:27:50 +0100 +Subject: mmc: sanitize 'bus width' in debug output + +From: Wolfram Sang + +commit ed9feec72fc1fa194ebfdb79e14561b35decce63 upstream. + +The bus width is sometimes the actual bus width, and sometimes indices +to different arrays encoding the bus width. In my debugging case "2" +could mean 8-bit as well as 4-bit, which was extremly confusing. Let's +use the human-readable actual bus width in all places. + +Signed-off-by: Wolfram Sang +Signed-off-by: Ulf Hansson +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/core/core.c | 2 +- + drivers/mmc/core/mmc.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/mmc/core/core.c ++++ b/drivers/mmc/core/core.c +@@ -1039,7 +1039,7 @@ static inline void mmc_set_ios(struct mm + "width %u timing %u\n", + mmc_hostname(host), ios->clock, ios->bus_mode, + ios->power_mode, ios->chip_select, ios->vdd, +- ios->bus_width, ios->timing); ++ 1 << ios->bus_width, ios->timing); + + host->ops->set_ios(host, ios); + } +--- a/drivers/mmc/core/mmc.c ++++ b/drivers/mmc/core/mmc.c +@@ -952,7 +952,7 @@ static int mmc_select_bus_width(struct m + break; + } else { + pr_warn("%s: switch to bus width %d failed\n", +- mmc_hostname(host), ext_csd_bits[idx]); ++ mmc_hostname(host), 1 << bus_width); + } + } + diff --git a/queue-4.4/serial-sprd-adjust-timeout-to-a-big-value.patch b/queue-4.4/serial-sprd-adjust-timeout-to-a-big-value.patch new file mode 100644 index 00000000000..03d00a5e4a9 --- /dev/null +++ b/queue-4.4/serial-sprd-adjust-timeout-to-a-big-value.patch @@ -0,0 +1,33 @@ +From e1dc9b08051a2c2e694edf48d1e704f07c7c143c Mon Sep 17 00:00:00 2001 +From: Wei Qiao +Date: Mon, 27 Mar 2017 14:06:42 +0800 +Subject: serial: sprd: adjust TIMEOUT to a big value + +From: Wei Qiao + +commit e1dc9b08051a2c2e694edf48d1e704f07c7c143c upstream. + +SPRD_TIMEOUT was 256, which is too small to wait until the status +switched to workable in a while loop, so that the earlycon could +not work correctly. + +Signed-off-by: Wei Qiao +Signed-off-by: Chunyan Zhang +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/sprd_serial.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/tty/serial/sprd_serial.c ++++ b/drivers/tty/serial/sprd_serial.c +@@ -36,7 +36,7 @@ + #define SPRD_FIFO_SIZE 128 + #define SPRD_DEF_RATE 26000000 + #define SPRD_BAUD_IO_LIMIT 3000000 +-#define SPRD_TIMEOUT 256 ++#define SPRD_TIMEOUT 256000 + + /* the offset of serial registers and BITs for them */ + /* data registers */ diff --git a/queue-4.4/series b/queue-4.4/series index 1d90504ac79..a09d5b8bf54 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -12,3 +12,19 @@ media-v4l2-ctrls.c-uvc-zero-v4l2_event.patch locking-lockdep-add-debug_locks-check-in-__lock_downgrade.patch alsa-hda-record-the-current-power-state-before-suspend-resume-calls.patch alsa-hda-enforces-runtime_resume-after-s3-and-s4-for-each-codec.patch +mmc-pwrseq_simple-make-reset-gpios-optional-to-match-doc.patch +mmc-debugfs-add-a-restriction-to-mmc-debugfs-clock-setting.patch +mmc-make-man_bkops_en-message-a-debug.patch +mmc-sanitize-bus-width-in-debug-output.patch +mmc-core-shut-up-voltage-ranges-unspecified-pr_info.patch +usb-dwc3-gadget-fix-suspend-resume-during-device-mode.patch +arm64-mm-add-trace_irqflags-annotations-to-do_debug_exception.patch +mmc-core-fix-using-wrong-io-voltage-if-mmc_select_hs200-fails.patch +mm-rmap-replace-bug_on-anon_vma-degree-with-vm_warn_on.patch +extcon-usb-gpio-don-t-miss-event-during-suspend-resume.patch +kbuild-setlocalversion-print-error-to-stderr.patch +usb-gadget-composite-fix-dereference-after-null-check-coverify-warning.patch +usb-gadget-add-the-gserial-port-checking-in-gs_start_tx.patch +mmc-core-don-t-try-to-switch-block-size-for-dual-rate-mode.patch +tcp-dccp-drop-syn-packets-if-accept-queue-is-full.patch +serial-sprd-adjust-timeout-to-a-big-value.patch diff --git a/queue-4.4/tcp-dccp-drop-syn-packets-if-accept-queue-is-full.patch b/queue-4.4/tcp-dccp-drop-syn-packets-if-accept-queue-is-full.patch new file mode 100644 index 00000000000..50a4663c36d --- /dev/null +++ b/queue-4.4/tcp-dccp-drop-syn-packets-if-accept-queue-is-full.patch @@ -0,0 +1,92 @@ +From 5ea8ea2cb7f1d0db15762c9b0bb9e7330425a071 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Wed, 26 Oct 2016 09:27:57 -0700 +Subject: tcp/dccp: drop SYN packets if accept queue is full + +From: Eric Dumazet + +commit 5ea8ea2cb7f1d0db15762c9b0bb9e7330425a071 upstream. + +Per listen(fd, backlog) rules, there is really no point accepting a SYN, +sending a SYNACK, and dropping the following ACK packet if accept queue +is full, because application is not draining accept queue fast enough. + +This behavior is fooling TCP clients that believe they established a +flow, while there is nothing at server side. They might then send about +10 MSS (if using IW10) that will be dropped anyway while server is under +stress. + +Signed-off-by: Eric Dumazet +Acked-by: Neal Cardwell +Acked-by: Yuchung Cheng +Signed-off-by: David S. Miller +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + + +--- + include/net/inet_connection_sock.h | 5 ----- + net/dccp/ipv4.c | 8 +------- + net/dccp/ipv6.c | 2 +- + net/ipv4/tcp_input.c | 8 +------- + 4 files changed, 3 insertions(+), 20 deletions(-) + +--- a/include/net/inet_connection_sock.h ++++ b/include/net/inet_connection_sock.h +@@ -289,11 +289,6 @@ static inline int inet_csk_reqsk_queue_l + return reqsk_queue_len(&inet_csk(sk)->icsk_accept_queue); + } + +-static inline int inet_csk_reqsk_queue_young(const struct sock *sk) +-{ +- return reqsk_queue_len_young(&inet_csk(sk)->icsk_accept_queue); +-} +- + static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk) + { + return inet_csk_reqsk_queue_len(sk) >= sk->sk_max_ack_backlog; +--- a/net/dccp/ipv4.c ++++ b/net/dccp/ipv4.c +@@ -592,13 +592,7 @@ int dccp_v4_conn_request(struct sock *sk + if (inet_csk_reqsk_queue_is_full(sk)) + goto drop; + +- /* +- * Accept backlog is full. If we have already queued enough +- * of warm entries in syn queue, drop request. It is better than +- * clogging syn queue with openreqs with exponentially increasing +- * timeout. +- */ +- if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) ++ if (sk_acceptq_is_full(sk)) + goto drop; + + req = inet_reqsk_alloc(&dccp_request_sock_ops, sk, true); +--- a/net/dccp/ipv6.c ++++ b/net/dccp/ipv6.c +@@ -324,7 +324,7 @@ static int dccp_v6_conn_request(struct s + if (inet_csk_reqsk_queue_is_full(sk)) + goto drop; + +- if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) ++ if (sk_acceptq_is_full(sk)) + goto drop; + + req = inet_reqsk_alloc(&dccp6_request_sock_ops, sk, true); +--- a/net/ipv4/tcp_input.c ++++ b/net/ipv4/tcp_input.c +@@ -6305,13 +6305,7 @@ int tcp_conn_request(struct request_sock + goto drop; + } + +- +- /* Accept backlog is full. If we have already queued enough +- * of warm entries in syn queue, drop request. It is better than +- * clogging syn queue with openreqs with exponentially increasing +- * timeout. +- */ +- if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) { ++ if (sk_acceptq_is_full(sk)) { + NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS); + goto drop; + } diff --git a/queue-4.4/usb-dwc3-gadget-fix-suspend-resume-during-device-mode.patch b/queue-4.4/usb-dwc3-gadget-fix-suspend-resume-during-device-mode.patch new file mode 100644 index 00000000000..38b8e0791e3 --- /dev/null +++ b/queue-4.4/usb-dwc3-gadget-fix-suspend-resume-during-device-mode.patch @@ -0,0 +1,47 @@ +From 9772b47a4c2916d645c551228b6085ea24acbe5d Mon Sep 17 00:00:00 2001 +From: Roger Quadros +Date: Tue, 12 Apr 2016 11:33:29 +0300 +Subject: usb: dwc3: gadget: Fix suspend/resume during device mode + +From: Roger Quadros + +commit 9772b47a4c2916d645c551228b6085ea24acbe5d upstream. + +Gadget controller might not be always active during system +suspend/resume as gadget driver might not have yet been loaded or +might have been unloaded prior to system suspend. + +Check if we're active and only then perform +necessary actions during suspend/resume. + +Signed-off-by: Roger Quadros +Signed-off-by: Felipe Balbi +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/gadget.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -2894,6 +2894,9 @@ void dwc3_gadget_exit(struct dwc3 *dwc) + + int dwc3_gadget_suspend(struct dwc3 *dwc) + { ++ if (!dwc->gadget_driver) ++ return 0; ++ + if (dwc->pullups_connected) { + dwc3_gadget_disable_irq(dwc); + dwc3_gadget_run_stop(dwc, true, true); +@@ -2912,6 +2915,9 @@ int dwc3_gadget_resume(struct dwc3 *dwc) + struct dwc3_ep *dep; + int ret; + ++ if (!dwc->gadget_driver) ++ return 0; ++ + /* Start with SuperSpeed Default */ + dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512); + diff --git a/queue-4.4/usb-gadget-add-the-gserial-port-checking-in-gs_start_tx.patch b/queue-4.4/usb-gadget-add-the-gserial-port-checking-in-gs_start_tx.patch new file mode 100644 index 00000000000..32cbcdda206 --- /dev/null +++ b/queue-4.4/usb-gadget-add-the-gserial-port-checking-in-gs_start_tx.patch @@ -0,0 +1,49 @@ +From 511a36d2f357724312bb3776d2f6eed3890928b2 Mon Sep 17 00:00:00 2001 +From: Baolin Wang +Date: Thu, 30 Jun 2016 17:10:23 +0800 +Subject: usb: gadget: Add the gserial port checking in gs_start_tx() + +From: Baolin Wang + +commit 511a36d2f357724312bb3776d2f6eed3890928b2 upstream. + +When usb gadget is set gadget serial function, it will be crash in below +situation. + +It will clean the 'port->port_usb' pointer in gserial_disconnect() function +when usb link is inactive, but it will release lock for disabling the endpoints +in this function. Druing the lock release period, it maybe complete one request +to issue gs_write_complete()--->gs_start_tx() function, but the 'port->port_usb' +pointer had been set NULL, thus it will be crash in gs_start_tx() function. + +This patch adds the 'port->port_usb' pointer checking in gs_start_tx() function +to avoid this situation. + +Signed-off-by: Baolin Wang +Signed-off-by: Felipe Balbi +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/function/u_serial.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/usb/gadget/function/u_serial.c ++++ b/drivers/usb/gadget/function/u_serial.c +@@ -361,10 +361,15 @@ __acquires(&port->port_lock) + */ + { + struct list_head *pool = &port->write_pool; +- struct usb_ep *in = port->port_usb->in; ++ struct usb_ep *in; + int status = 0; + bool do_tty_wake = false; + ++ if (!port->port_usb) ++ return status; ++ ++ in = port->port_usb->in; ++ + while (!port->write_busy && !list_empty(pool)) { + struct usb_request *req; + int len; diff --git a/queue-4.4/usb-gadget-composite-fix-dereference-after-null-check-coverify-warning.patch b/queue-4.4/usb-gadget-composite-fix-dereference-after-null-check-coverify-warning.patch new file mode 100644 index 00000000000..9b08f32c250 --- /dev/null +++ b/queue-4.4/usb-gadget-composite-fix-dereference-after-null-check-coverify-warning.patch @@ -0,0 +1,32 @@ +From c526c62d565ea5a5bba9433f28756079734f430d Mon Sep 17 00:00:00 2001 +From: Peter Chen +Date: Fri, 1 Jul 2016 15:33:28 +0800 +Subject: usb: gadget: composite: fix dereference after null check coverify warning + +From: Peter Chen + +commit c526c62d565ea5a5bba9433f28756079734f430d upstream. + +cdev->config is checked for null pointer at above code, so cdev->config +might be null, fix it by adding null pointer check. + +Signed-off-by: Peter Chen +Signed-off-by: Felipe Balbi +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/composite.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/gadget/composite.c ++++ b/drivers/usb/gadget/composite.c +@@ -1819,6 +1819,8 @@ unknown: + break; + + case USB_RECIP_ENDPOINT: ++ if (!cdev->config) ++ break; + endp = ((w_index & 0x80) >> 3) | (w_index & 0x0f); + list_for_each_entry(f, &cdev->config->functions, list) { + if (test_bit(endp, f->endpoints))