]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Apr 2025 10:29:07 +0000 (12:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Apr 2025 10:29:07 +0000 (12:29 +0200)
added patches:
mm-slab-remove-duplicate-kernel-doc-comment-for-ksize.patch
mmc-sdhci-brcmstb-use-clk_get_rate-base_clk-in-pm-resume.patch

queue-5.15/mm-slab-remove-duplicate-kernel-doc-comment-for-ksize.patch [new file with mode: 0644]
queue-5.15/mmc-sdhci-brcmstb-use-clk_get_rate-base_clk-in-pm-resume.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/mm-slab-remove-duplicate-kernel-doc-comment-for-ksize.patch b/queue-5.15/mm-slab-remove-duplicate-kernel-doc-comment-for-ksize.patch
new file mode 100644 (file)
index 0000000..cace3dc
--- /dev/null
@@ -0,0 +1,58 @@
+From c18c20f16219516b12a4f2fd29c25e06be97e064 Mon Sep 17 00:00:00 2001
+From: Vlastimil Babka <vbabka@suse.cz>
+Date: Mon, 7 Nov 2022 17:11:27 +0100
+Subject: mm, slab: remove duplicate kernel-doc comment for ksize()
+
+From: Vlastimil Babka <vbabka@suse.cz>
+
+commit c18c20f16219516b12a4f2fd29c25e06be97e064 upstream.
+
+Akira reports:
+
+> "make htmldocs" reports duplicate C declaration of ksize() as follows:
+
+> /linux/Documentation/core-api/mm-api:43: ./mm/slab_common.c:1428: WARNING: Duplicate C declaration, also defined at core-api/mm-api:212.
+> Declaration is '.. c:function:: size_t ksize (const void *objp)'.
+
+> This is due to the kernel-doc comment for ksize() declaration added in
+> include/linux/slab.h by commit 05a940656e1e ("slab: Introduce
+> kmalloc_size_roundup()").
+
+There is an older kernel-doc comment for ksize() definition in
+mm/slab_common.c, which is not only duplicated, but also contradicts the
+new one - the additional storage discovered by ksize() should not be
+used by callers anymore. Delete the old kernel-doc.
+
+Reported-by: Akira Yokosawa <akiyks@gmail.com>
+Link: https://lore.kernel.org/all/d33440f6-40cf-9747-3340-e54ffaf7afb8@gmail.com/
+Fixes: 05a940656e1e ("slab: Introduce kmalloc_size_roundup()")
+Cc: Kees Cook <keescook@chromium.org>
+Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/slab_common.c |   14 --------------
+ 1 file changed, 14 deletions(-)
+
+--- a/mm/slab_common.c
++++ b/mm/slab_common.c
+@@ -1305,20 +1305,6 @@ void kfree_sensitive(const void *p)
+ }
+ EXPORT_SYMBOL(kfree_sensitive);
+-/**
+- * ksize - get the actual amount of memory allocated for a given object
+- * @objp: Pointer to the object
+- *
+- * kmalloc may internally round up allocations and return more memory
+- * than requested. ksize() can be used to determine the actual amount of
+- * memory allocated. The caller may use this additional memory, even though
+- * a smaller amount of memory was initially specified with the kmalloc call.
+- * The caller must guarantee that objp points to a valid object previously
+- * allocated with either kmalloc() or kmem_cache_alloc(). The object
+- * must not be freed during the duration of the call.
+- *
+- * Return: size of the actual memory used by @objp in bytes
+- */
+ size_t ksize(const void *objp)
+ {
+       size_t size;
diff --git a/queue-5.15/mmc-sdhci-brcmstb-use-clk_get_rate-base_clk-in-pm-resume.patch b/queue-5.15/mmc-sdhci-brcmstb-use-clk_get_rate-base_clk-in-pm-resume.patch
new file mode 100644 (file)
index 0000000..b49d900
--- /dev/null
@@ -0,0 +1,42 @@
+From 886201c70a1cab34ef96f867c2b2dd6379ffa7b9 Mon Sep 17 00:00:00 2001
+From: Kamal Dasu <kdasu.kdev@gmail.com>
+Date: Thu, 14 Jul 2022 13:41:32 -0400
+Subject: mmc: sdhci-brcmstb: use clk_get_rate(base_clk) in PM resume
+
+From: Kamal Dasu <kdasu.kdev@gmail.com>
+
+commit 886201c70a1cab34ef96f867c2b2dd6379ffa7b9 upstream.
+
+Use clk_get_rate for base_clk on resume before setting new rate.
+This change ensures that the clock api returns current rate
+and sets the clock to the desired rate and honors CLK_GET_NO_CACHE
+attribute used by clock api.
+
+Fixes: 97904a59855c (mmc: sdhci-brcmstb: Add ability to increase max clock rate for 72116b0)
+Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Link: https://lore.kernel.org/r/20220714174132.18541-1-kdasu.kdev@gmail.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/host/sdhci-brcmstb.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/sdhci-brcmstb.c
++++ b/drivers/mmc/host/sdhci-brcmstb.c
+@@ -414,7 +414,14 @@ static int sdhci_brcmstb_resume(struct d
+       ret = sdhci_pltfm_resume(dev);
+       if (!ret && priv->base_freq_hz) {
+               ret = clk_prepare_enable(priv->base_clk);
+-              if (!ret)
++              /*
++               * Note: using clk_get_rate() below as clk_get_rate()
++               * honors CLK_GET_RATE_NOCACHE attribute, but clk_set_rate()
++               * may do implicit get_rate() calls that do not honor
++               * CLK_GET_RATE_NOCACHE.
++               */
++              if (!ret &&
++                  (clk_get_rate(priv->base_clk) != priv->base_freq_hz))
+                       ret = clk_set_rate(priv->base_clk, priv->base_freq_hz);
+       }
index ae6cec8d8ba156d66c15377e58b588c260650e91..fdc2df0b27d0b495bdcec0ecdd6956d0b4dea8f1 100644 (file)
@@ -275,3 +275,5 @@ jfs-fix-slab-out-of-bounds-read-in-ea_get.patch
 jfs-add-index-corruption-check-to-dt_getpage.patch
 nfsd-put-dl_stid-if-fail-to-queue-dl_recall.patch
 nfsd-skip-sending-cb_recall_any-when-the-backchannel-isn-t-up.patch
+mmc-sdhci-brcmstb-use-clk_get_rate-base_clk-in-pm-resume.patch
+mm-slab-remove-duplicate-kernel-doc-comment-for-ksize.patch