]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Sep 2020 15:13:17 +0000 (17:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Sep 2020 15:13:17 +0000 (17:13 +0200)
added patches:
cfg80211-regulatory-reject-invalid-hints.patch
checkpatch-fix-the-usage-of-capture-group.patch
mm-hugetlb-fix-a-race-between-hugetlb-sysctl-handlers.patch
mm-khugepaged.c-fix-khugepaged-s-request-size-in-collapse_file.patch
net-usb-fix-uninit-was-stored-issue-in-asix_read_phy_addr.patch
perf-record-correct-the-help-info-of-option-no-bpf-event.patch
sdhci-tegra-add-missing-tmclk-for-data-timeout.patch

queue-5.4/cfg80211-regulatory-reject-invalid-hints.patch [new file with mode: 0644]
queue-5.4/checkpatch-fix-the-usage-of-capture-group.patch [new file with mode: 0644]
queue-5.4/mm-hugetlb-fix-a-race-between-hugetlb-sysctl-handlers.patch [new file with mode: 0644]
queue-5.4/mm-khugepaged.c-fix-khugepaged-s-request-size-in-collapse_file.patch [new file with mode: 0644]
queue-5.4/net-usb-fix-uninit-was-stored-issue-in-asix_read_phy_addr.patch [new file with mode: 0644]
queue-5.4/perf-record-correct-the-help-info-of-option-no-bpf-event.patch [new file with mode: 0644]
queue-5.4/sdhci-tegra-add-missing-tmclk-for-data-timeout.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/cfg80211-regulatory-reject-invalid-hints.patch b/queue-5.4/cfg80211-regulatory-reject-invalid-hints.patch
new file mode 100644 (file)
index 0000000..0fc9979
--- /dev/null
@@ -0,0 +1,34 @@
+From 47caf685a6854593348f216e0b489b71c10cbe03 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Wed, 19 Aug 2020 10:46:48 +0200
+Subject: cfg80211: regulatory: reject invalid hints
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit 47caf685a6854593348f216e0b489b71c10cbe03 upstream.
+
+Reject invalid hints early in order to not cause a kernel
+WARN later if they're restored to or similar.
+
+Reported-by: syzbot+d451401ffd00a60677ee@syzkaller.appspotmail.com
+Link: https://syzkaller.appspot.com/bug?extid=d451401ffd00a60677ee
+Link: https://lore.kernel.org/r/20200819084648.13956-1-johannes@sipsolutions.net
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/wireless/reg.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/net/wireless/reg.c
++++ b/net/wireless/reg.c
+@@ -2941,6 +2941,9 @@ int regulatory_hint_user(const char *alp
+       if (WARN_ON(!alpha2))
+               return -EINVAL;
++      if (!is_world_regdom(alpha2) && !is_an_alpha2(alpha2))
++              return -EINVAL;
++
+       request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
+       if (!request)
+               return -ENOMEM;
diff --git a/queue-5.4/checkpatch-fix-the-usage-of-capture-group.patch b/queue-5.4/checkpatch-fix-the-usage-of-capture-group.patch
new file mode 100644 (file)
index 0000000..4a32b73
--- /dev/null
@@ -0,0 +1,58 @@
+From 13e45417cedbfc44b1926124b1846f5ee8c6ba4a Mon Sep 17 00:00:00 2001
+From: Mrinal Pandey <mrinalmni@gmail.com>
+Date: Fri, 4 Sep 2020 16:35:52 -0700
+Subject: checkpatch: fix the usage of capture group ( ... )
+
+From: Mrinal Pandey <mrinalmni@gmail.com>
+
+commit 13e45417cedbfc44b1926124b1846f5ee8c6ba4a upstream.
+
+The usage of "capture group (...)" in the immediate condition after `&&`
+results in `$1` being uninitialized.  This issues a warning "Use of
+uninitialized value $1 in regexp compilation at ./scripts/checkpatch.pl
+line 2638".
+
+I noticed this bug while running checkpatch on the set of commits from
+v5.7 to v5.8-rc1 of the kernel on the commits with a diff content in
+their commit message.
+
+This bug was introduced in the script by commit e518e9a59ec3
+("checkpatch: emit an error when there's a diff in a changelog").  It
+has been in the script since then.
+
+The author intended to store the match made by capture group in variable
+`$1`.  This should have contained the name of the file as `[\w/]+`
+matched.  However, this couldn't be accomplished due to usage of capture
+group and `$1` in the same regular expression.
+
+Fix this by placing the capture group in the condition before `&&`.
+Thus, `$1` can be initialized to the text that capture group matches
+thereby setting it to the desired and required value.
+
+Fixes: e518e9a59ec3 ("checkpatch: emit an error when there's a diff in a changelog")
+Signed-off-by: Mrinal Pandey <mrinalmni@gmail.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Tested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
+Reviewed-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
+Cc: Joe Perches <joe@perches.com>
+Link: https://lkml.kernel.org/r/20200714032352.f476hanaj2dlmiot@mrinalpandey
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ scripts/checkpatch.pl |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/scripts/checkpatch.pl
++++ b/scripts/checkpatch.pl
+@@ -2576,8 +2576,8 @@ sub process {
+ # Check if the commit log has what seems like a diff which can confuse patch
+               if ($in_commit_log && !$commit_log_has_diff &&
+-                  (($line =~ m@^\s+diff\b.*a/[\w/]+@ &&
+-                    $line =~ m@^\s+diff\b.*a/([\w/]+)\s+b/$1\b@) ||
++                  (($line =~ m@^\s+diff\b.*a/([\w/]+)@ &&
++                    $line =~ m@^\s+diff\b.*a/[\w/]+\s+b/$1\b@) ||
+                    $line =~ m@^\s*(?:\-\-\-\s+a/|\+\+\+\s+b/)@ ||
+                    $line =~ m/^\s*\@\@ \-\d+,\d+ \+\d+,\d+ \@\@/)) {
+                       ERROR("DIFF_IN_COMMIT_MSG",
diff --git a/queue-5.4/mm-hugetlb-fix-a-race-between-hugetlb-sysctl-handlers.patch b/queue-5.4/mm-hugetlb-fix-a-race-between-hugetlb-sysctl-handlers.patch
new file mode 100644 (file)
index 0000000..00a26b5
--- /dev/null
@@ -0,0 +1,119 @@
+From 17743798d81238ab13050e8e2833699b54e15467 Mon Sep 17 00:00:00 2001
+From: Muchun Song <songmuchun@bytedance.com>
+Date: Fri, 4 Sep 2020 16:36:13 -0700
+Subject: mm/hugetlb: fix a race between hugetlb sysctl handlers
+
+From: Muchun Song <songmuchun@bytedance.com>
+
+commit 17743798d81238ab13050e8e2833699b54e15467 upstream.
+
+There is a race between the assignment of `table->data` and write value
+to the pointer of `table->data` in the __do_proc_doulongvec_minmax() on
+the other thread.
+
+  CPU0:                                 CPU1:
+                                        proc_sys_write
+  hugetlb_sysctl_handler                  proc_sys_call_handler
+  hugetlb_sysctl_handler_common             hugetlb_sysctl_handler
+    table->data = &tmp;                       hugetlb_sysctl_handler_common
+                                                table->data = &tmp;
+      proc_doulongvec_minmax
+        do_proc_doulongvec_minmax           sysctl_head_finish
+          __do_proc_doulongvec_minmax         unuse_table
+            i = table->data;
+            *i = val;  // corrupt CPU1's stack
+
+Fix this by duplicating the `table`, and only update the duplicate of
+it.  And introduce a helper of proc_hugetlb_doulongvec_minmax() to
+simplify the code.
+
+The following oops was seen:
+
+    BUG: kernel NULL pointer dereference, address: 0000000000000000
+    #PF: supervisor instruction fetch in kernel mode
+    #PF: error_code(0x0010) - not-present page
+    Code: Bad RIP value.
+    ...
+    Call Trace:
+     ? set_max_huge_pages+0x3da/0x4f0
+     ? alloc_pool_huge_page+0x150/0x150
+     ? proc_doulongvec_minmax+0x46/0x60
+     ? hugetlb_sysctl_handler_common+0x1c7/0x200
+     ? nr_hugepages_store+0x20/0x20
+     ? copy_fd_bitmaps+0x170/0x170
+     ? hugetlb_sysctl_handler+0x1e/0x20
+     ? proc_sys_call_handler+0x2f1/0x300
+     ? unregister_sysctl_table+0xb0/0xb0
+     ? __fd_install+0x78/0x100
+     ? proc_sys_write+0x14/0x20
+     ? __vfs_write+0x4d/0x90
+     ? vfs_write+0xef/0x240
+     ? ksys_write+0xc0/0x160
+     ? __ia32_sys_read+0x50/0x50
+     ? __close_fd+0x129/0x150
+     ? __x64_sys_write+0x43/0x50
+     ? do_syscall_64+0x6c/0x200
+     ? entry_SYSCALL_64_after_hwframe+0x44/0xa9
+
+Fixes: e5ff215941d5 ("hugetlb: multiple hstates for multiple page sizes")
+Signed-off-by: Muchun Song <songmuchun@bytedance.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
+Cc: Andi Kleen <ak@linux.intel.com>
+Link: http://lkml.kernel.org/r/20200828031146.43035-1-songmuchun@bytedance.com
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/hugetlb.c |   26 ++++++++++++++++++++------
+ 1 file changed, 20 insertions(+), 6 deletions(-)
+
+--- a/mm/hugetlb.c
++++ b/mm/hugetlb.c
+@@ -3082,6 +3082,22 @@ static unsigned int cpuset_mems_nr(unsig
+ }
+ #ifdef CONFIG_SYSCTL
++static int proc_hugetlb_doulongvec_minmax(struct ctl_table *table, int write,
++                                        void *buffer, size_t *length,
++                                        loff_t *ppos, unsigned long *out)
++{
++      struct ctl_table dup_table;
++
++      /*
++       * In order to avoid races with __do_proc_doulongvec_minmax(), we
++       * can duplicate the @table and alter the duplicate of it.
++       */
++      dup_table = *table;
++      dup_table.data = out;
++
++      return proc_doulongvec_minmax(&dup_table, write, buffer, length, ppos);
++}
++
+ static int hugetlb_sysctl_handler_common(bool obey_mempolicy,
+                        struct ctl_table *table, int write,
+                        void __user *buffer, size_t *length, loff_t *ppos)
+@@ -3093,9 +3109,8 @@ static int hugetlb_sysctl_handler_common
+       if (!hugepages_supported())
+               return -EOPNOTSUPP;
+-      table->data = &tmp;
+-      table->maxlen = sizeof(unsigned long);
+-      ret = proc_doulongvec_minmax(table, write, buffer, length, ppos);
++      ret = proc_hugetlb_doulongvec_minmax(table, write, buffer, length, ppos,
++                                           &tmp);
+       if (ret)
+               goto out;
+@@ -3139,9 +3154,8 @@ int hugetlb_overcommit_handler(struct ct
+       if (write && hstate_is_gigantic(h))
+               return -EINVAL;
+-      table->data = &tmp;
+-      table->maxlen = sizeof(unsigned long);
+-      ret = proc_doulongvec_minmax(table, write, buffer, length, ppos);
++      ret = proc_hugetlb_doulongvec_minmax(table, write, buffer, length, ppos,
++                                           &tmp);
+       if (ret)
+               goto out;
diff --git a/queue-5.4/mm-khugepaged.c-fix-khugepaged-s-request-size-in-collapse_file.patch b/queue-5.4/mm-khugepaged.c-fix-khugepaged-s-request-size-in-collapse_file.patch
new file mode 100644 (file)
index 0000000..dfa984e
--- /dev/null
@@ -0,0 +1,42 @@
+From e5a59d308f52bb0052af5790c22173651b187465 Mon Sep 17 00:00:00 2001
+From: David Howells <dhowells@redhat.com>
+Date: Fri, 4 Sep 2020 16:36:16 -0700
+Subject: mm/khugepaged.c: fix khugepaged's request size in collapse_file
+
+From: David Howells <dhowells@redhat.com>
+
+commit e5a59d308f52bb0052af5790c22173651b187465 upstream.
+
+collapse_file() in khugepaged passes PAGE_SIZE as the number of pages to
+be read to page_cache_sync_readahead().  The intent was probably to read
+a single page.  Fix it to use the number of pages to the end of the
+window instead.
+
+Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS")
+Signed-off-by: David Howells <dhowells@redhat.com>
+Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
+Acked-by: Song Liu <songliubraving@fb.com>
+Acked-by: Yang Shi <shy828301@gmail.com>
+Acked-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
+Cc: Eric Biggers <ebiggers@google.com>
+Link: https://lkml.kernel.org/r/20200903140844.14194-2-willy@infradead.org
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/khugepaged.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/mm/khugepaged.c
++++ b/mm/khugepaged.c
+@@ -1592,7 +1592,7 @@ static void collapse_file(struct mm_stru
+                               xas_unlock_irq(&xas);
+                               page_cache_sync_readahead(mapping, &file->f_ra,
+                                                         file, index,
+-                                                        PAGE_SIZE);
++                                                        end - index);
+                               /* drain pagevecs to help isolate_lru_page() */
+                               lru_add_drain();
+                               page = find_lock_page(mapping, index);
diff --git a/queue-5.4/net-usb-fix-uninit-was-stored-issue-in-asix_read_phy_addr.patch b/queue-5.4/net-usb-fix-uninit-was-stored-issue-in-asix_read_phy_addr.patch
new file mode 100644 (file)
index 0000000..da3b16c
--- /dev/null
@@ -0,0 +1,34 @@
+From a092b7233f0e000cc6f2c71a49e2ecc6f917a5fc Mon Sep 17 00:00:00 2001
+From: Himadri Pandya <himadrispandya@gmail.com>
+Date: Thu, 27 Aug 2020 12:23:55 +0530
+Subject: net: usb: Fix uninit-was-stored issue in asix_read_phy_addr()
+
+From: Himadri Pandya <himadrispandya@gmail.com>
+
+commit a092b7233f0e000cc6f2c71a49e2ecc6f917a5fc upstream.
+
+The buffer size is 2 Bytes and we expect to receive the same amount of
+data. But sometimes we receive less data and run into uninit-was-stored
+issue upon read. Hence modify the error check on the return value to match
+with the buffer size as a prevention.
+
+Reported-and-tested by: syzbot+a7e220df5a81d1ab400e@syzkaller.appspotmail.com
+Signed-off-by: Himadri Pandya <himadrispandya@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/usb/asix_common.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/usb/asix_common.c
++++ b/drivers/net/usb/asix_common.c
+@@ -296,7 +296,7 @@ int asix_read_phy_addr(struct usbnet *de
+       netdev_dbg(dev->net, "asix_get_phy_addr()\n");
+-      if (ret < 0) {
++      if (ret < 2) {
+               netdev_err(dev->net, "Error reading PHYID register: %02x\n", ret);
+               goto out;
+       }
diff --git a/queue-5.4/perf-record-correct-the-help-info-of-option-no-bpf-event.patch b/queue-5.4/perf-record-correct-the-help-info-of-option-no-bpf-event.patch
new file mode 100644 (file)
index 0000000..fb06cc7
--- /dev/null
@@ -0,0 +1,56 @@
+From a060c1f12b525ba828f871eff3127dabf8daa1e6 Mon Sep 17 00:00:00 2001
+From: Wei Li <liwei391@huawei.com>
+Date: Wed, 19 Aug 2020 11:19:47 +0800
+Subject: perf record: Correct the help info of option "--no-bpf-event"
+
+From: Wei Li <liwei391@huawei.com>
+
+commit a060c1f12b525ba828f871eff3127dabf8daa1e6 upstream.
+
+The help info of option "--no-bpf-event" is wrongly described as "record
+bpf events", correct it.
+
+Committer testing:
+
+  $ perf record -h bpf
+
+   Usage: perf record [<options>] [<command>]
+      or: perf record [<options>] -- <command> [<options>]
+
+          --clang-opt <clang options>
+                            options passed to clang when compiling BPF scriptlets
+          --clang-path <clang path>
+                            clang binary to use for compiling BPF scriptlets
+          --no-bpf-event    do not record bpf events
+
+  $
+
+Fixes: 71184c6ab7e6 ("perf record: Replace option --bpf-event with --no-bpf-event")
+Signed-off-by: Wei Li <liwei391@huawei.com>
+Acked-by: Song Liu <songliubraving@fb.com>
+Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Hanjun Guo <guohanjun@huawei.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Li Bin <huawei.libin@huawei.com>
+Cc: Mark Rutland <mark.rutland@arm.com>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Link: http://lore.kernel.org/lkml/20200819031947.12115-1-liwei391@huawei.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ tools/perf/builtin-record.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/perf/builtin-record.c
++++ b/tools/perf/builtin-record.c
+@@ -2137,7 +2137,7 @@ static struct option __record_options[]
+       OPT_BOOLEAN(0, "tail-synthesize", &record.opts.tail_synthesize,
+                   "synthesize non-sample events at the end of output"),
+       OPT_BOOLEAN(0, "overwrite", &record.opts.overwrite, "use overwrite mode"),
+-      OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "record bpf events"),
++      OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "do not record bpf events"),
+       OPT_BOOLEAN(0, "strict-freq", &record.opts.strict_freq,
+                   "Fail if the specified frequency can't be used"),
+       OPT_CALLBACK('F', "freq", &record.opts, "freq or 'max'",
diff --git a/queue-5.4/sdhci-tegra-add-missing-tmclk-for-data-timeout.patch b/queue-5.4/sdhci-tegra-add-missing-tmclk-for-data-timeout.patch
new file mode 100644 (file)
index 0000000..65c6d73
--- /dev/null
@@ -0,0 +1,151 @@
+From 8048822bac01936fda2c7b924a52131da81e6198 Mon Sep 17 00:00:00 2001
+From: Sowjanya Komatineni <skomatineni@nvidia.com>
+Date: Thu, 27 Aug 2020 10:21:01 -0700
+Subject: sdhci: tegra: Add missing TMCLK for data timeout
+
+From: Sowjanya Komatineni <skomatineni@nvidia.com>
+
+commit 8048822bac01936fda2c7b924a52131da81e6198 upstream.
+
+commit b5a84ecf025a ("mmc: tegra: Add Tegra210 support")
+
+Tegra210 and later has a separate sdmmc_legacy_tm (TMCLK) used by Tegra
+SDMMC hawdware for data timeout to achive better timeout than using
+SDCLK and using TMCLK is recommended.
+
+USE_TMCLK_FOR_DATA_TIMEOUT bit in Tegra SDMMC register
+SDHCI_TEGRA_VENDOR_SYS_SW_CTRL can be used to choose either TMCLK or
+SDCLK for data timeout.
+
+Default USE_TMCLK_FOR_DATA_TIMEOUT bit is set to 1 and TMCLK is used
+for data timeout by Tegra SDMMC hardware and having TMCLK not enabled
+is not recommended.
+
+So, this patch adds quirk NVQUIRK_HAS_TMCLK for SoC having separate
+timeout clock and keeps TMCLK enabled all the time.
+
+Fixes: b5a84ecf025a ("mmc: tegra: Add Tegra210 support")
+Cc: stable <stable@vger.kernel.org> # 5.4
+Tested-by: Jon Hunter <jonathanh@nvidia.com>
+Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
+Link: https://lore.kernel.org/r/1598548861-32373-8-git-send-email-skomatineni@nvidia.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/sdhci-tegra.c |   53 +++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 51 insertions(+), 2 deletions(-)
+
+--- a/drivers/mmc/host/sdhci-tegra.c
++++ b/drivers/mmc/host/sdhci-tegra.c
+@@ -100,6 +100,12 @@
+ #define NVQUIRK_DIS_CARD_CLK_CONFIG_TAP                       BIT(8)
+ #define NVQUIRK_CQHCI_DCMD_R1B_CMD_TIMING             BIT(9)
++/*
++ * NVQUIRK_HAS_TMCLK is for SoC's having separate timeout clock for Tegra
++ * SDMMC hardware data timeout.
++ */
++#define NVQUIRK_HAS_TMCLK                             BIT(10)
++
+ /* SDMMC CQE Base Address for Tegra Host Ver 4.1 and Higher */
+ #define SDHCI_TEGRA_CQE_BASE_ADDR                     0xF000
+@@ -130,6 +136,7 @@ struct sdhci_tegra_autocal_offsets {
+ struct sdhci_tegra {
+       const struct sdhci_tegra_soc_data *soc_data;
+       struct gpio_desc *power_gpio;
++      struct clk *tmclk;
+       bool ddr_signaling;
+       bool pad_calib_required;
+       bool pad_control_available;
+@@ -1385,7 +1392,8 @@ static const struct sdhci_tegra_soc_data
+                   NVQUIRK_HAS_PADCALIB |
+                   NVQUIRK_DIS_CARD_CLK_CONFIG_TAP |
+                   NVQUIRK_ENABLE_SDR50 |
+-                  NVQUIRK_ENABLE_SDR104,
++                  NVQUIRK_ENABLE_SDR104 |
++                  NVQUIRK_HAS_TMCLK,
+       .min_tap_delay = 106,
+       .max_tap_delay = 185,
+ };
+@@ -1422,6 +1430,7 @@ static const struct sdhci_tegra_soc_data
+                   NVQUIRK_DIS_CARD_CLK_CONFIG_TAP |
+                   NVQUIRK_ENABLE_SDR50 |
+                   NVQUIRK_ENABLE_SDR104 |
++                  NVQUIRK_HAS_TMCLK |
+                   NVQUIRK_CQHCI_DCMD_R1B_CMD_TIMING,
+       .min_tap_delay = 84,
+       .max_tap_delay = 136,
+@@ -1434,7 +1443,8 @@ static const struct sdhci_tegra_soc_data
+                   NVQUIRK_HAS_PADCALIB |
+                   NVQUIRK_DIS_CARD_CLK_CONFIG_TAP |
+                   NVQUIRK_ENABLE_SDR50 |
+-                  NVQUIRK_ENABLE_SDR104,
++                  NVQUIRK_ENABLE_SDR104 |
++                  NVQUIRK_HAS_TMCLK,
+       .min_tap_delay = 96,
+       .max_tap_delay = 139,
+ };
+@@ -1562,6 +1572,43 @@ static int sdhci_tegra_probe(struct plat
+               goto err_power_req;
+       }
++      /*
++       * Tegra210 has a separate SDMMC_LEGACY_TM clock used for host
++       * timeout clock and SW can choose TMCLK or SDCLK for hardware
++       * data timeout through the bit USE_TMCLK_FOR_DATA_TIMEOUT of
++       * the register SDHCI_TEGRA_VENDOR_SYS_SW_CTRL.
++       *
++       * USE_TMCLK_FOR_DATA_TIMEOUT bit default is set to 1 and SDMMC uses
++       * 12Mhz TMCLK which is advertised in host capability register.
++       * With TMCLK of 12Mhz provides maximum data timeout period that can
++       * be achieved is 11s better than using SDCLK for data timeout.
++       *
++       * So, TMCLK is set to 12Mhz and kept enabled all the time on SoC's
++       * supporting separate TMCLK.
++       */
++
++      if (soc_data->nvquirks & NVQUIRK_HAS_TMCLK) {
++              clk = devm_clk_get(&pdev->dev, "tmclk");
++              if (IS_ERR(clk)) {
++                      rc = PTR_ERR(clk);
++                      if (rc == -EPROBE_DEFER)
++                              goto err_power_req;
++
++                      dev_warn(&pdev->dev, "failed to get tmclk: %d\n", rc);
++                      clk = NULL;
++              }
++
++              clk_set_rate(clk, 12000000);
++              rc = clk_prepare_enable(clk);
++              if (rc) {
++                      dev_err(&pdev->dev,
++                              "failed to enable tmclk: %d\n", rc);
++                      goto err_power_req;
++              }
++
++              tegra_host->tmclk = clk;
++      }
++
+       clk = devm_clk_get(mmc_dev(host->mmc), NULL);
+       if (IS_ERR(clk)) {
+               rc = PTR_ERR(clk);
+@@ -1605,6 +1652,7 @@ err_add_host:
+ err_rst_get:
+       clk_disable_unprepare(pltfm_host->clk);
+ err_clk_get:
++      clk_disable_unprepare(tegra_host->tmclk);
+ err_power_req:
+ err_parse_dt:
+       sdhci_pltfm_free(pdev);
+@@ -1622,6 +1670,7 @@ static int sdhci_tegra_remove(struct pla
+       reset_control_assert(tegra_host->rst);
+       usleep_range(2000, 4000);
+       clk_disable_unprepare(pltfm_host->clk);
++      clk_disable_unprepare(tegra_host->tmclk);
+       sdhci_pltfm_free(pdev);
index e260aa1fcd13bf3c8edffad26a4119b0303994c6..51e5a524a58120614e6b92f1766934cc8e07d86a 100644 (file)
@@ -120,3 +120,10 @@ dm-thin-metadata-fix-use-after-free-in-dm_bm_set_read_only.patch
 mm-slub-fix-conversion-of-freelist_corrupted.patch
 mm-madvise-fix-vma-user-after-free.patch
 vfio-pci-fix-sr-iov-vf-handling-with-mmio-blocking.patch
+perf-record-correct-the-help-info-of-option-no-bpf-event.patch
+sdhci-tegra-add-missing-tmclk-for-data-timeout.patch
+checkpatch-fix-the-usage-of-capture-group.patch
+mm-hugetlb-fix-a-race-between-hugetlb-sysctl-handlers.patch
+mm-khugepaged.c-fix-khugepaged-s-request-size-in-collapse_file.patch
+cfg80211-regulatory-reject-invalid-hints.patch
+net-usb-fix-uninit-was-stored-issue-in-asix_read_phy_addr.patch