]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.20-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jan 2019 09:58:21 +0000 (10:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Jan 2019 09:58:21 +0000 (10:58 +0100)
added patches:
btrfs-fix-deadlock-when-using-free-space-tree-due-to-block-group-creation.patch
cpufreq-scmi-fix-frequency-invariance-in-slow-path.patch
cpufreq-scpi-scmi-fix-freeing-of-dynamic-opps.patch
staging-rtl8188eu-fix-module-loading-from-tasklet-for-ccmp-encryption.patch
staging-rtl8188eu-fix-module-loading-from-tasklet-for-wep-encryption.patch
usbcore-select-only-first-configuration-for-non-uac3-compliant-devices.patch
x86-modpost-replace-last-remnants-of-retpoline-with-config_retpoline.patch

queue-4.20/btrfs-fix-deadlock-when-using-free-space-tree-due-to-block-group-creation.patch [new file with mode: 0644]
queue-4.20/cpufreq-scmi-fix-frequency-invariance-in-slow-path.patch [new file with mode: 0644]
queue-4.20/cpufreq-scpi-scmi-fix-freeing-of-dynamic-opps.patch [new file with mode: 0644]
queue-4.20/series
queue-4.20/staging-rtl8188eu-fix-module-loading-from-tasklet-for-ccmp-encryption.patch [new file with mode: 0644]
queue-4.20/staging-rtl8188eu-fix-module-loading-from-tasklet-for-wep-encryption.patch [new file with mode: 0644]
queue-4.20/usbcore-select-only-first-configuration-for-non-uac3-compliant-devices.patch [new file with mode: 0644]
queue-4.20/x86-modpost-replace-last-remnants-of-retpoline-with-config_retpoline.patch [new file with mode: 0644]

diff --git a/queue-4.20/btrfs-fix-deadlock-when-using-free-space-tree-due-to-block-group-creation.patch b/queue-4.20/btrfs-fix-deadlock-when-using-free-space-tree-due-to-block-group-creation.patch
new file mode 100644 (file)
index 0000000..88c9f73
--- /dev/null
@@ -0,0 +1,64 @@
+From a6d8654d885d7d79a3fb82da64eaa489ca332a82 Mon Sep 17 00:00:00 2001
+From: Filipe Manana <fdmanana@suse.com>
+Date: Tue, 8 Jan 2019 11:44:41 +0000
+Subject: Btrfs: fix deadlock when using free space tree due to block group creation
+
+From: Filipe Manana <fdmanana@suse.com>
+
+commit a6d8654d885d7d79a3fb82da64eaa489ca332a82 upstream.
+
+When modifying the free space tree we can end up COWing one of its extent
+buffers which in turn might result in allocating a new chunk, which in
+turn can result in flushing (finish creation) of pending block groups. If
+that happens we can deadlock because creating a pending block group needs
+to update the free space tree, and if any of the updates tries to modify
+the same extent buffer that we are COWing, we end up in a deadlock since
+we try to write lock twice the same extent buffer.
+
+So fix this by skipping pending block group creation if we are COWing an
+extent buffer from the free space tree. This is a case missed by commit
+5ce555578e091 ("Btrfs: fix deadlock when writing out free space caches").
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202173
+Fixes: 5ce555578e091 ("Btrfs: fix deadlock when writing out free space caches")
+CC: stable@vger.kernel.org # 4.18+
+Signed-off-by: Filipe Manana <fdmanana@suse.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/ctree.c |   16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+--- a/fs/btrfs/ctree.c
++++ b/fs/btrfs/ctree.c
+@@ -1015,19 +1015,21 @@ static noinline int __btrfs_cow_block(st
+               parent_start = parent->start;
+       /*
+-       * If we are COWing a node/leaf from the extent, chunk or device trees,
+-       * make sure that we do not finish block group creation of pending block
+-       * groups. We do this to avoid a deadlock.
++       * If we are COWing a node/leaf from the extent, chunk, device or free
++       * space trees, make sure that we do not finish block group creation of
++       * pending block groups. We do this to avoid a deadlock.
+        * COWing can result in allocation of a new chunk, and flushing pending
+        * block groups (btrfs_create_pending_block_groups()) can be triggered
+        * when finishing allocation of a new chunk. Creation of a pending block
+-       * group modifies the extent, chunk and device trees, therefore we could
+-       * deadlock with ourselves since we are holding a lock on an extent
+-       * buffer that btrfs_create_pending_block_groups() may try to COW later.
++       * group modifies the extent, chunk, device and free space trees,
++       * therefore we could deadlock with ourselves since we are holding a
++       * lock on an extent buffer that btrfs_create_pending_block_groups() may
++       * try to COW later.
+        */
+       if (root == fs_info->extent_root ||
+           root == fs_info->chunk_root ||
+-          root == fs_info->dev_root)
++          root == fs_info->dev_root ||
++          root == fs_info->free_space_root)
+               trans->can_flush_pending_bgs = false;
+       cow = btrfs_alloc_tree_block(trans, root, parent_start,
diff --git a/queue-4.20/cpufreq-scmi-fix-frequency-invariance-in-slow-path.patch b/queue-4.20/cpufreq-scmi-fix-frequency-invariance-in-slow-path.patch
new file mode 100644 (file)
index 0000000..24a2c69
--- /dev/null
@@ -0,0 +1,44 @@
+From 0e141d1c65c1dd31c914eb2e11651adcc1a15912 Mon Sep 17 00:00:00 2001
+From: Quentin Perret <quentin.perret@arm.com>
+Date: Wed, 9 Jan 2019 10:42:36 +0000
+Subject: cpufreq: scmi: Fix frequency invariance in slow path
+
+From: Quentin Perret <quentin.perret@arm.com>
+
+commit 0e141d1c65c1dd31c914eb2e11651adcc1a15912 upstream.
+
+The scmi-cpufreq driver calls the arch_set_freq_scale() callback on
+frequency changes to provide scale-invariant load-tracking signals to
+the scheduler. However, in the slow path, it does so while specifying
+the current and max frequencies in different units, hence resulting in a
+broken freq_scale factor.
+
+Fix this by passing all frequencies in KHz, as stored in the CPUFreq
+frequency table.
+
+Fixes: 99d6bdf33877 (cpufreq: add support for CPU DVFS based on SCMI message protocol)
+Signed-off-by: Quentin Perret <quentin.perret@arm.com>
+Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
+Acked-by: Sudeep Holla <sudeep.holla@arm.com>
+Cc: 4.17+ <stable@vger.kernel.org> # v4.17+
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/scmi-cpufreq.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/cpufreq/scmi-cpufreq.c
++++ b/drivers/cpufreq/scmi-cpufreq.c
+@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_p
+       int ret;
+       struct scmi_data *priv = policy->driver_data;
+       struct scmi_perf_ops *perf_ops = handle->perf_ops;
+-      u64 freq = policy->freq_table[index].frequency * 1000;
++      u64 freq = policy->freq_table[index].frequency;
+-      ret = perf_ops->freq_set(handle, priv->domain_id, freq, false);
++      ret = perf_ops->freq_set(handle, priv->domain_id, freq * 1000, false);
+       if (!ret)
+               arch_set_freq_scale(policy->related_cpus, freq,
+                                   policy->cpuinfo.max_freq);
diff --git a/queue-4.20/cpufreq-scpi-scmi-fix-freeing-of-dynamic-opps.patch b/queue-4.20/cpufreq-scpi-scmi-fix-freeing-of-dynamic-opps.patch
new file mode 100644 (file)
index 0000000..7c98ea2
--- /dev/null
@@ -0,0 +1,201 @@
+From 1690d8bb91e370ab772062b79bd434ce815c4729 Mon Sep 17 00:00:00 2001
+From: Viresh Kumar <viresh.kumar@linaro.org>
+Date: Fri, 4 Jan 2019 15:14:33 +0530
+Subject: cpufreq: scpi/scmi: Fix freeing of dynamic OPPs
+
+From: Viresh Kumar <viresh.kumar@linaro.org>
+
+commit 1690d8bb91e370ab772062b79bd434ce815c4729 upstream.
+
+Since the commit 2a4eb7358aba "OPP: Don't remove dynamic OPPs from
+_dev_pm_opp_remove_table()", dynamically created OPP aren't
+automatically removed anymore by dev_pm_opp_cpumask_remove_table(). This
+affects the scpi and scmi cpufreq drivers which no longer free OPPs on
+failures or on invocations of the policy->exit() callback.
+
+Create a generic OPP helper dev_pm_opp_remove_all_dynamic() which can be
+called from these drivers instead of dev_pm_opp_cpumask_remove_table().
+
+In dev_pm_opp_remove_all_dynamic(), we need to make sure that the
+opp_list isn't getting accessed simultaneously from other parts of the
+OPP core while the helper is freeing dynamic OPPs, i.e. we can't drop
+the opp_table->lock while traversing through the OPP list. And to
+accomplish that, this patch also creates _opp_kref_release_unlocked()
+which can be called from this new helper with the opp_table lock already
+held.
+
+Cc: 4.20 <stable@vger.kernel.org> # v4.20
+Reported-by: Valentin Schneider <valentin.schneider@arm.com>
+Fixes: 2a4eb7358aba "OPP: Don't remove dynamic OPPs from _dev_pm_opp_remove_table()"
+Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
+Tested-by: Valentin Schneider <valentin.schneider@arm.com>
+Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/scmi-cpufreq.c |    4 +-
+ drivers/cpufreq/scpi-cpufreq.c |    4 +-
+ drivers/opp/core.c             |   63 +++++++++++++++++++++++++++++++++++++----
+ include/linux/pm_opp.h         |    5 +++
+ 4 files changed, 67 insertions(+), 9 deletions(-)
+
+--- a/drivers/cpufreq/scmi-cpufreq.c
++++ b/drivers/cpufreq/scmi-cpufreq.c
+@@ -176,7 +176,7 @@ static int scmi_cpufreq_init(struct cpuf
+ out_free_priv:
+       kfree(priv);
+ out_free_opp:
+-      dev_pm_opp_cpumask_remove_table(policy->cpus);
++      dev_pm_opp_remove_all_dynamic(cpu_dev);
+       return ret;
+ }
+@@ -188,7 +188,7 @@ static int scmi_cpufreq_exit(struct cpuf
+       cpufreq_cooling_unregister(priv->cdev);
+       dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
+       kfree(priv);
+-      dev_pm_opp_cpumask_remove_table(policy->related_cpus);
++      dev_pm_opp_remove_all_dynamic(priv->cpu_dev);
+       return 0;
+ }
+--- a/drivers/cpufreq/scpi-cpufreq.c
++++ b/drivers/cpufreq/scpi-cpufreq.c
+@@ -177,7 +177,7 @@ out_free_cpufreq_table:
+ out_free_priv:
+       kfree(priv);
+ out_free_opp:
+-      dev_pm_opp_cpumask_remove_table(policy->cpus);
++      dev_pm_opp_remove_all_dynamic(cpu_dev);
+       return ret;
+ }
+@@ -190,7 +190,7 @@ static int scpi_cpufreq_exit(struct cpuf
+       clk_put(priv->clk);
+       dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
+       kfree(priv);
+-      dev_pm_opp_cpumask_remove_table(policy->related_cpus);
++      dev_pm_opp_remove_all_dynamic(priv->cpu_dev);
+       return 0;
+ }
+--- a/drivers/opp/core.c
++++ b/drivers/opp/core.c
+@@ -951,11 +951,9 @@ void _opp_free(struct dev_pm_opp *opp)
+       kfree(opp);
+ }
+-static void _opp_kref_release(struct kref *kref)
++static void _opp_kref_release(struct dev_pm_opp *opp,
++                            struct opp_table *opp_table)
+ {
+-      struct dev_pm_opp *opp = container_of(kref, struct dev_pm_opp, kref);
+-      struct opp_table *opp_table = opp->opp_table;
+-
+       /*
+        * Notify the changes in the availability of the operable
+        * frequency/voltage list.
+@@ -964,7 +962,22 @@ static void _opp_kref_release(struct kre
+       opp_debug_remove_one(opp);
+       list_del(&opp->node);
+       kfree(opp);
++}
++
++static void _opp_kref_release_unlocked(struct kref *kref)
++{
++      struct dev_pm_opp *opp = container_of(kref, struct dev_pm_opp, kref);
++      struct opp_table *opp_table = opp->opp_table;
++
++      _opp_kref_release(opp, opp_table);
++}
++static void _opp_kref_release_locked(struct kref *kref)
++{
++      struct dev_pm_opp *opp = container_of(kref, struct dev_pm_opp, kref);
++      struct opp_table *opp_table = opp->opp_table;
++
++      _opp_kref_release(opp, opp_table);
+       mutex_unlock(&opp_table->lock);
+ }
+@@ -975,10 +988,16 @@ void dev_pm_opp_get(struct dev_pm_opp *o
+ void dev_pm_opp_put(struct dev_pm_opp *opp)
+ {
+-      kref_put_mutex(&opp->kref, _opp_kref_release, &opp->opp_table->lock);
++      kref_put_mutex(&opp->kref, _opp_kref_release_locked,
++                     &opp->opp_table->lock);
+ }
+ EXPORT_SYMBOL_GPL(dev_pm_opp_put);
++static void dev_pm_opp_put_unlocked(struct dev_pm_opp *opp)
++{
++      kref_put(&opp->kref, _opp_kref_release_unlocked);
++}
++
+ /**
+  * dev_pm_opp_remove()  - Remove an OPP from OPP table
+  * @dev:      device for which we do this operation
+@@ -1022,6 +1041,40 @@ void dev_pm_opp_remove(struct device *de
+ }
+ EXPORT_SYMBOL_GPL(dev_pm_opp_remove);
++/**
++ * dev_pm_opp_remove_all_dynamic() - Remove all dynamically created OPPs
++ * @dev:      device for which we do this operation
++ *
++ * This function removes all dynamically created OPPs from the opp table.
++ */
++void dev_pm_opp_remove_all_dynamic(struct device *dev)
++{
++      struct opp_table *opp_table;
++      struct dev_pm_opp *opp, *temp;
++      int count = 0;
++
++      opp_table = _find_opp_table(dev);
++      if (IS_ERR(opp_table))
++              return;
++
++      mutex_lock(&opp_table->lock);
++      list_for_each_entry_safe(opp, temp, &opp_table->opp_list, node) {
++              if (opp->dynamic) {
++                      dev_pm_opp_put_unlocked(opp);
++                      count++;
++              }
++      }
++      mutex_unlock(&opp_table->lock);
++
++      /* Drop the references taken by dev_pm_opp_add() */
++      while (count--)
++              dev_pm_opp_put_opp_table(opp_table);
++
++      /* Drop the reference taken by _find_opp_table() */
++      dev_pm_opp_put_opp_table(opp_table);
++}
++EXPORT_SYMBOL_GPL(dev_pm_opp_remove_all_dynamic);
++
+ struct dev_pm_opp *_opp_allocate(struct opp_table *table)
+ {
+       struct dev_pm_opp *opp;
+--- a/include/linux/pm_opp.h
++++ b/include/linux/pm_opp.h
+@@ -108,6 +108,7 @@ void dev_pm_opp_put(struct dev_pm_opp *o
+ int dev_pm_opp_add(struct device *dev, unsigned long freq,
+                  unsigned long u_volt);
+ void dev_pm_opp_remove(struct device *dev, unsigned long freq);
++void dev_pm_opp_remove_all_dynamic(struct device *dev);
+ int dev_pm_opp_enable(struct device *dev, unsigned long freq);
+@@ -214,6 +215,10 @@ static inline void dev_pm_opp_remove(str
+ {
+ }
++static inline void dev_pm_opp_remove_all_dynamic(struct device *dev)
++{
++}
++
+ static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq)
+ {
+       return 0;
index de1379c5f0a4b32fbceaf936e3e92a4a3443fb9e..93162ab92a3b8bd3c47735274d8d7efe8dbf3c4f 100644 (file)
@@ -1 +1,8 @@
 powerpc-tm-unset-msr-if-not-recheckpointing.patch
+btrfs-fix-deadlock-when-using-free-space-tree-due-to-block-group-creation.patch
+usbcore-select-only-first-configuration-for-non-uac3-compliant-devices.patch
+staging-rtl8188eu-fix-module-loading-from-tasklet-for-ccmp-encryption.patch
+staging-rtl8188eu-fix-module-loading-from-tasklet-for-wep-encryption.patch
+cpufreq-scpi-scmi-fix-freeing-of-dynamic-opps.patch
+cpufreq-scmi-fix-frequency-invariance-in-slow-path.patch
+x86-modpost-replace-last-remnants-of-retpoline-with-config_retpoline.patch
diff --git a/queue-4.20/staging-rtl8188eu-fix-module-loading-from-tasklet-for-ccmp-encryption.patch b/queue-4.20/staging-rtl8188eu-fix-module-loading-from-tasklet-for-ccmp-encryption.patch
new file mode 100644 (file)
index 0000000..86bffdf
--- /dev/null
@@ -0,0 +1,39 @@
+From 84cad97a717f5749a0236abd5ce68da582ea074f Mon Sep 17 00:00:00 2001
+From: Larry Finger <Larry.Finger@lwfinger.net>
+Date: Wed, 2 Jan 2019 20:12:46 -0600
+Subject: staging: rtl8188eu: Fix module loading from tasklet for CCMP encryption
+
+From: Larry Finger <Larry.Finger@lwfinger.net>
+
+commit 84cad97a717f5749a0236abd5ce68da582ea074f upstream.
+
+Commit 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt")
+causes scheduling while atomic bugs followed by a hard freeze whenever
+the driver tries to connect to a CCMP-encrypted network. Experimentation
+showed that the freezes were eliminated when module lib80211 was
+preloaded, which can be forced by calling lib80211_get_crypto_ops()
+directly rather than indirectly through try_then_request_module().
+With this change, no BUG messages are logged.
+
+Fixes: 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt")
+Cc: Stable <stable@vger.kernel.org> # v4.17+
+Reported-and-tested-by: Michael Straube <straube.linux@gmail.com>
+Cc: Ivan Safonov <insafonov@gmail.com>
+Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/rtl8188eu/core/rtw_security.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/rtl8188eu/core/rtw_security.c
++++ b/drivers/staging/rtl8188eu/core/rtw_security.c
+@@ -1291,7 +1291,7 @@ u32 rtw_aes_decrypt(struct adapter *pada
+                       struct sk_buff *skb = ((struct recv_frame *)precvframe)->pkt;
+                       void *crypto_private = NULL;
+                       u8 *key, *pframe = skb->data;
+-                      struct lib80211_crypto_ops *crypto_ops = try_then_request_module(lib80211_get_crypto_ops("CCMP"), "lib80211_crypt_ccmp");
++                      struct lib80211_crypto_ops *crypto_ops = lib80211_get_crypto_ops("CCMP");
+                       struct security_priv *psecuritypriv = &padapter->securitypriv;
+                       char iv[8], icv[8];
diff --git a/queue-4.20/staging-rtl8188eu-fix-module-loading-from-tasklet-for-wep-encryption.patch b/queue-4.20/staging-rtl8188eu-fix-module-loading-from-tasklet-for-wep-encryption.patch
new file mode 100644 (file)
index 0000000..a8afaee
--- /dev/null
@@ -0,0 +1,48 @@
+From 7775665aadc48a562051834a73519129bf717d73 Mon Sep 17 00:00:00 2001
+From: Larry Finger <Larry.Finger@lwfinger.net>
+Date: Wed, 2 Jan 2019 20:12:47 -0600
+Subject: staging: rtl8188eu: Fix module loading from tasklet for WEP encryption
+
+From: Larry Finger <Larry.Finger@lwfinger.net>
+
+commit 7775665aadc48a562051834a73519129bf717d73 upstream.
+
+Commit 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames")
+causes scheduling while atomic bugs followed by a hard freeze whenever
+the driver tries to connect to a WEP-encrypted network. Experimentation
+showed that the freezes were eliminated when module lib80211 was
+preloaded, which can be forced by calling lib80211_get_crypto_ops()
+directly rather than indirectly through try_then_request_module().
+With this change, no BUG messages are logged.
+
+Fixes: 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames")
+Cc: Stable <stable@vger.kernel.org> # v4.17+
+Cc: Michael Straube <straube.linux@gmail.com>
+Cc: Ivan Safonov <insafonov@gmail.com>
+Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/rtl8188eu/core/rtw_security.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/rtl8188eu/core/rtw_security.c
++++ b/drivers/staging/rtl8188eu/core/rtw_security.c
+@@ -154,7 +154,7 @@ void rtw_wep_encrypt(struct adapter *pad
+       pframe = ((struct xmit_frame *)pxmitframe)->buf_addr + hw_hdr_offset;
+-      crypto_ops = try_then_request_module(lib80211_get_crypto_ops("WEP"), "lib80211_crypt_wep");
++      crypto_ops = lib80211_get_crypto_ops("WEP");
+       if (!crypto_ops)
+               return;
+@@ -210,7 +210,7 @@ int rtw_wep_decrypt(struct adapter  *pad
+               void *crypto_private = NULL;
+               int status = _SUCCESS;
+               const int keyindex = prxattrib->key_index;
+-              struct lib80211_crypto_ops *crypto_ops = try_then_request_module(lib80211_get_crypto_ops("WEP"), "lib80211_crypt_wep");
++              struct lib80211_crypto_ops *crypto_ops = lib80211_get_crypto_ops("WEP");
+               char iv[4], icv[4];
+               if (!crypto_ops) {
diff --git a/queue-4.20/usbcore-select-only-first-configuration-for-non-uac3-compliant-devices.patch b/queue-4.20/usbcore-select-only-first-configuration-for-non-uac3-compliant-devices.patch
new file mode 100644 (file)
index 0000000..be19450
--- /dev/null
@@ -0,0 +1,47 @@
+From ff2a8c532c14fd22fb26a36574d9ff199afbbe54 Mon Sep 17 00:00:00 2001
+From: Saranya Gopal <saranya.gopal@intel.com>
+Date: Sun, 6 Jan 2019 08:14:02 +0530
+Subject: usbcore: Select only first configuration for non-UAC3 compliant devices
+
+From: Saranya Gopal <saranya.gopal@intel.com>
+
+commit ff2a8c532c14fd22fb26a36574d9ff199afbbe54 upstream.
+
+In most of the UAC1 and UAC2 audio devices, the first
+configuration is most often the best configuration.
+However, with recent patch to support UAC3 configuration,
+second configuration was unintentionally chosen for
+some of the UAC1/2 devices that had more than one
+configuration. This was because of the existing check
+after the audio config check which selected any config
+which had a non-vendor class. This patch fixes this issue.
+
+Fixes: f13912d3f014 ("usbcore: Select UAC3 configuration for audio if present")
+Reported-by: Con Kolivas <kernel@kolivas.org>
+Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
+Tested-by: Con Kolivas <kernel@kolivas.org>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/core/generic.c |    9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/core/generic.c
++++ b/drivers/usb/core/generic.c
+@@ -143,9 +143,12 @@ int usb_choose_configuration(struct usb_
+                       continue;
+               }
+-              if (i > 0 && desc && is_audio(desc) && is_uac3_config(desc)) {
+-                      best = c;
+-                      break;
++              if (i > 0 && desc && is_audio(desc)) {
++                      if (is_uac3_config(desc)) {
++                              best = c;
++                              break;
++                      }
++                      continue;
+               }
+               /* From the remaining configs, choose the first one whose
diff --git a/queue-4.20/x86-modpost-replace-last-remnants-of-retpoline-with-config_retpoline.patch b/queue-4.20/x86-modpost-replace-last-remnants-of-retpoline-with-config_retpoline.patch
new file mode 100644 (file)
index 0000000..76a15f4
--- /dev/null
@@ -0,0 +1,99 @@
+From e4f358916d528d479c3c12bd2fd03f2d5a576380 Mon Sep 17 00:00:00 2001
+From: WANG Chao <chao.wang@ucloud.cn>
+Date: Tue, 11 Dec 2018 00:37:25 +0800
+Subject: x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE
+
+From: WANG Chao <chao.wang@ucloud.cn>
+
+commit e4f358916d528d479c3c12bd2fd03f2d5a576380 upstream.
+
+Commit
+
+  4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
+
+replaced the RETPOLINE define with CONFIG_RETPOLINE checks. Remove the
+remaining pieces.
+
+ [ bp: Massage commit message. ]
+
+Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
+Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Reviewed-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
+Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Cc: "H. Peter Anvin" <hpa@zytor.com>
+Cc: Andi Kleen <ak@linux.intel.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Andy Lutomirski <luto@kernel.org>
+Cc: Arnd Bergmann <arnd@arndb.de>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: David Woodhouse <dwmw@amazon.co.uk>
+Cc: Geert Uytterhoeven <geert@linux-m68k.org>
+Cc: Jessica Yu <jeyu@kernel.org>
+Cc: Jiri Kosina <jkosina@suse.cz>
+Cc: Kees Cook <keescook@chromium.org>
+Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
+Cc: Michal Marek <michal.lkml@markovi.net>
+Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Tim Chen <tim.c.chen@linux.intel.com>
+Cc: Vasily Gorbik <gor@linux.ibm.com>
+Cc: linux-kbuild@vger.kernel.org
+Cc: srinivas.eeda@oracle.com
+Cc: stable <stable@vger.kernel.org>
+Cc: x86-ml <x86@kernel.org>
+Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/cpu/bugs.c   |    2 +-
+ include/linux/compiler-gcc.h |    2 +-
+ include/linux/module.h       |    2 +-
+ scripts/mod/modpost.c        |    2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/arch/x86/kernel/cpu/bugs.c
++++ b/arch/x86/kernel/cpu/bugs.c
+@@ -213,7 +213,7 @@ static enum spectre_v2_mitigation spectr
+ static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init =
+       SPECTRE_V2_USER_NONE;
+-#ifdef RETPOLINE
++#ifdef CONFIG_RETPOLINE
+ static bool spectre_v2_bad_module;
+ bool retpoline_module_ok(bool has_retpoline)
+--- a/include/linux/compiler-gcc.h
++++ b/include/linux/compiler-gcc.h
+@@ -68,7 +68,7 @@
+  */
+ #define uninitialized_var(x) x = x
+-#ifdef RETPOLINE
++#ifdef CONFIG_RETPOLINE
+ #define __noretpoline __attribute__((__indirect_branch__("keep")))
+ #endif
+--- a/include/linux/module.h
++++ b/include/linux/module.h
+@@ -817,7 +817,7 @@ static inline void module_bug_finalize(c
+ static inline void module_bug_cleanup(struct module *mod) {}
+ #endif        /* CONFIG_GENERIC_BUG */
+-#ifdef RETPOLINE
++#ifdef CONFIG_RETPOLINE
+ extern bool retpoline_module_ok(bool has_retpoline);
+ #else
+ static inline bool retpoline_module_ok(bool has_retpoline)
+--- a/scripts/mod/modpost.c
++++ b/scripts/mod/modpost.c
+@@ -2157,7 +2157,7 @@ static void add_intree_flag(struct buffe
+ /* Cannot check for assembler */
+ static void add_retpoline(struct buffer *b)
+ {
+-      buf_printf(b, "\n#ifdef RETPOLINE\n");
++      buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n");
+       buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n");
+       buf_printf(b, "#endif\n");
+ }