]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Drop soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
authorSasha Levin <sashal@kernel.org>
Fri, 21 Feb 2020 15:54:49 +0000 (10:54 -0500)
committerSasha Levin <sashal@kernel.org>
Fri, 21 Feb 2020 15:54:49 +0000 (10:54 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/series
queue-4.14/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch [deleted file]
queue-4.19/series
queue-4.19/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch [deleted file]
queue-4.9/series
queue-4.9/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch [deleted file]
queue-5.4/series
queue-5.4/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch [deleted file]
queue-5.5/series
queue-5.5/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch [deleted file]

index 96a5172ac8098e97e16907b19d9bf1aa2a82eaca..1373ad8c0503c676a5a41efce918baa00fddee4a 100644 (file)
@@ -32,7 +32,6 @@ revert-kvm-vmx-add-non-canonical-check-on-writes-to-.patch
 kvm-nvmx-use-correct-root-level-for-nested-ept-shado.patch
 drm-gma500-fixup-fbdev-stolen-size-usage-evaluation.patch
 nfsd4-avoid-null-deference-on-strange-copy-compounds.patch
-soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
 cpu-hotplug-stop_machine-fix-stop_machine-vs-hotplug.patch
 brcmfmac-fix-use-after-free-in-brcmf_sdio_readframes.patch
 leds-pca963x-fix-open-drain-initialization.patch
diff --git a/queue-4.14/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch b/queue-4.14/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
deleted file mode 100644 (file)
index 9ce362a..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-From 81b703fc72b9c63a53ea46d8e01356cca3f69cf6 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 28 Nov 2019 15:55:40 +0100
-Subject: soc: fsl: qe: change return type of cpm_muram_alloc() to s32
-
-From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-
-[ Upstream commit 800cd6fb76f0ec7711deb72a86c924db1ae42648 ]
-
-There are a number of problems with cpm_muram_alloc() and its
-callers. Most callers assign the return value to some variable and
-then use IS_ERR_VALUE to check for allocation failure. However, when
-that variable is not sizeof(long), this leads to warnings - and it is
-indeed broken to do e.g.
-
-  u32 foo = cpm_muram_alloc();
-  if (IS_ERR_VALUE(foo))
-
-on a 64-bit platform, since the condition
-
-  foo >= (unsigned long)-ENOMEM
-
-is tautologically false. There are also callers that ignore the
-possibility of error, and then there are those that check for error by
-comparing the return value to 0...
-
-One could fix that by changing all callers to store the return value
-temporarily in an "unsigned long" and test that. However, use of
-IS_ERR_VALUE() is error-prone and should be restricted to things which
-are inherently long-sized (stuff in pt_regs etc.). Instead, let's aim
-for changing to the standard kernel style
-
-  int foo = cpm_muram_alloc();
-  if (foo < 0)
-    deal_with_it()
-  some->where = foo;
-
-Changing the return type from unsigned long to s32 (aka signed int)
-doesn't change the value that gets stored into any of the callers'
-variables except if the caller was storing the result in a u64 _and_
-the allocation failed, so in itself this patch should be a no-op.
-
-Another problem with cpm_muram_alloc() is that it can certainly
-validly return 0 - and except if some cpm_muram_alloc_fixed() call
-interferes, the very first cpm_muram_alloc() call will return just
-that. But that shows that both ucc_slow_free() and ucc_fast_free() are
-buggy, since they assume that a value of 0 means "that field was never
-allocated". We'll later change cpm_muram_free() to accept (and ignore)
-a negative offset, so callers can use a sentinel of -1 instead of 0
-and just unconditionally call cpm_muram_free().
-
-Reviewed-by: Timur Tabi <timur@kernel.org>
-Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-Signed-off-by: Li Yang <leoyang.li@nxp.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/soc/fsl/qe/qe_common.c | 29 ++++++++++++++++-------------
- include/soc/fsl/qe/qe.h        | 16 ++++++++--------
- 2 files changed, 24 insertions(+), 21 deletions(-)
-
-diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c
-index 104e68d9b84f2..4f60724b06b7c 100644
---- a/drivers/soc/fsl/qe/qe_common.c
-+++ b/drivers/soc/fsl/qe/qe_common.c
-@@ -35,7 +35,7 @@ static phys_addr_t muram_pbase;
- struct muram_block {
-       struct list_head head;
--      unsigned long start;
-+      s32 start;
-       int size;
- };
-@@ -113,13 +113,14 @@ out_muram:
-  * @algo: algorithm for alloc.
-  * @data: data for genalloc's algorithm.
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  */
--static unsigned long cpm_muram_alloc_common(unsigned long size,
--              genpool_algo_t algo, void *data)
-+static s32 cpm_muram_alloc_common(unsigned long size,
-+                                genpool_algo_t algo, void *data)
- {
-       struct muram_block *entry;
--      unsigned long start;
-+      s32 start;
-       if (!muram_pool && cpm_muram_init())
-               goto out2;
-@@ -140,7 +141,7 @@ static unsigned long cpm_muram_alloc_common(unsigned long size,
- out1:
-       gen_pool_free(muram_pool, start, size);
- out2:
--      return (unsigned long)-ENOMEM;
-+      return -ENOMEM;
- }
- /*
-@@ -148,13 +149,14 @@ out2:
-  * @size: number of bytes to allocate
-  * @align: requested alignment, in bytes
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align)
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_align muram_pool_data;
-@@ -171,7 +173,7 @@ EXPORT_SYMBOL(cpm_muram_alloc);
-  * cpm_muram_free - free a chunk of multi-user ram
-  * @offset: The beginning of the chunk as returned by cpm_muram_alloc().
-  */
--int cpm_muram_free(unsigned long offset)
-+int cpm_muram_free(s32 offset)
- {
-       unsigned long flags;
-       int size;
-@@ -197,13 +199,14 @@ EXPORT_SYMBOL(cpm_muram_free);
-  * cpm_muram_alloc_fixed - reserve a specific region of multi-user ram
-  * @offset: offset of allocation start address
-  * @size: number of bytes to allocate
-- * This function returns an offset into the muram area
-+ * This function returns @offset if the area was available, a negative
-+ * errno otherwise.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_fixed muram_pool_data_fixed;
-diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h
-index b3d1aff5e8ad5..deb6238416947 100644
---- a/include/soc/fsl/qe/qe.h
-+++ b/include/soc/fsl/qe/qe.h
-@@ -102,26 +102,26 @@ static inline void qe_reset(void) {}
- int cpm_muram_init(void);
- #if defined(CONFIG_CPM) || defined(CONFIG_QUICC_ENGINE)
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
--int cpm_muram_free(unsigned long offset);
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align);
-+int cpm_muram_free(s32 offset);
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
- void __iomem *cpm_muram_addr(unsigned long offset);
- unsigned long cpm_muram_offset(void __iomem *addr);
- dma_addr_t cpm_muram_dma(void __iomem *addr);
- #else
--static inline unsigned long cpm_muram_alloc(unsigned long size,
--                                          unsigned long align)
-+static inline s32 cpm_muram_alloc(unsigned long size,
-+                                unsigned long align)
- {
-       return -ENOSYS;
- }
--static inline int cpm_muram_free(unsigned long offset)
-+static inline int cpm_muram_free(s32 offset)
- {
-       return -ENOSYS;
- }
--static inline unsigned long cpm_muram_alloc_fixed(unsigned long offset,
--                                                unsigned long size)
-+static inline s32 cpm_muram_alloc_fixed(unsigned long offset,
-+                                      unsigned long size)
- {
-       return -ENOSYS;
- }
--- 
-2.20.1
-
index 687667fc906f383f701682620fb52c0f3662435b..01ee2e0b391a8b045df9219391a78332a023924e 100644 (file)
@@ -9,7 +9,6 @@ revert-kvm-vmx-add-non-canonical-check-on-writes-to-.patch
 kvm-nvmx-use-correct-root-level-for-nested-ept-shado.patch
 drm-gma500-fixup-fbdev-stolen-size-usage-evaluation.patch
 nfsd4-avoid-null-deference-on-strange-copy-compounds.patch
-soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
 cpu-hotplug-stop_machine-fix-stop_machine-vs-hotplug.patch
 brcmfmac-fix-use-after-free-in-brcmf_sdio_readframes.patch
 leds-pca963x-fix-open-drain-initialization.patch
diff --git a/queue-4.19/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch b/queue-4.19/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
deleted file mode 100644 (file)
index c70e170..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-From e766160fc3817ce0d3ef35e29dfaf66555bcfb0d Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 28 Nov 2019 15:55:40 +0100
-Subject: soc: fsl: qe: change return type of cpm_muram_alloc() to s32
-
-From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-
-[ Upstream commit 800cd6fb76f0ec7711deb72a86c924db1ae42648 ]
-
-There are a number of problems with cpm_muram_alloc() and its
-callers. Most callers assign the return value to some variable and
-then use IS_ERR_VALUE to check for allocation failure. However, when
-that variable is not sizeof(long), this leads to warnings - and it is
-indeed broken to do e.g.
-
-  u32 foo = cpm_muram_alloc();
-  if (IS_ERR_VALUE(foo))
-
-on a 64-bit platform, since the condition
-
-  foo >= (unsigned long)-ENOMEM
-
-is tautologically false. There are also callers that ignore the
-possibility of error, and then there are those that check for error by
-comparing the return value to 0...
-
-One could fix that by changing all callers to store the return value
-temporarily in an "unsigned long" and test that. However, use of
-IS_ERR_VALUE() is error-prone and should be restricted to things which
-are inherently long-sized (stuff in pt_regs etc.). Instead, let's aim
-for changing to the standard kernel style
-
-  int foo = cpm_muram_alloc();
-  if (foo < 0)
-    deal_with_it()
-  some->where = foo;
-
-Changing the return type from unsigned long to s32 (aka signed int)
-doesn't change the value that gets stored into any of the callers'
-variables except if the caller was storing the result in a u64 _and_
-the allocation failed, so in itself this patch should be a no-op.
-
-Another problem with cpm_muram_alloc() is that it can certainly
-validly return 0 - and except if some cpm_muram_alloc_fixed() call
-interferes, the very first cpm_muram_alloc() call will return just
-that. But that shows that both ucc_slow_free() and ucc_fast_free() are
-buggy, since they assume that a value of 0 means "that field was never
-allocated". We'll later change cpm_muram_free() to accept (and ignore)
-a negative offset, so callers can use a sentinel of -1 instead of 0
-and just unconditionally call cpm_muram_free().
-
-Reviewed-by: Timur Tabi <timur@kernel.org>
-Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-Signed-off-by: Li Yang <leoyang.li@nxp.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/soc/fsl/qe/qe_common.c | 29 ++++++++++++++++-------------
- include/soc/fsl/qe/qe.h        | 16 ++++++++--------
- 2 files changed, 24 insertions(+), 21 deletions(-)
-
-diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c
-index 104e68d9b84f2..4f60724b06b7c 100644
---- a/drivers/soc/fsl/qe/qe_common.c
-+++ b/drivers/soc/fsl/qe/qe_common.c
-@@ -35,7 +35,7 @@ static phys_addr_t muram_pbase;
- struct muram_block {
-       struct list_head head;
--      unsigned long start;
-+      s32 start;
-       int size;
- };
-@@ -113,13 +113,14 @@ out_muram:
-  * @algo: algorithm for alloc.
-  * @data: data for genalloc's algorithm.
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  */
--static unsigned long cpm_muram_alloc_common(unsigned long size,
--              genpool_algo_t algo, void *data)
-+static s32 cpm_muram_alloc_common(unsigned long size,
-+                                genpool_algo_t algo, void *data)
- {
-       struct muram_block *entry;
--      unsigned long start;
-+      s32 start;
-       if (!muram_pool && cpm_muram_init())
-               goto out2;
-@@ -140,7 +141,7 @@ static unsigned long cpm_muram_alloc_common(unsigned long size,
- out1:
-       gen_pool_free(muram_pool, start, size);
- out2:
--      return (unsigned long)-ENOMEM;
-+      return -ENOMEM;
- }
- /*
-@@ -148,13 +149,14 @@ out2:
-  * @size: number of bytes to allocate
-  * @align: requested alignment, in bytes
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align)
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_align muram_pool_data;
-@@ -171,7 +173,7 @@ EXPORT_SYMBOL(cpm_muram_alloc);
-  * cpm_muram_free - free a chunk of multi-user ram
-  * @offset: The beginning of the chunk as returned by cpm_muram_alloc().
-  */
--int cpm_muram_free(unsigned long offset)
-+int cpm_muram_free(s32 offset)
- {
-       unsigned long flags;
-       int size;
-@@ -197,13 +199,14 @@ EXPORT_SYMBOL(cpm_muram_free);
-  * cpm_muram_alloc_fixed - reserve a specific region of multi-user ram
-  * @offset: offset of allocation start address
-  * @size: number of bytes to allocate
-- * This function returns an offset into the muram area
-+ * This function returns @offset if the area was available, a negative
-+ * errno otherwise.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_fixed muram_pool_data_fixed;
-diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h
-index b3d1aff5e8ad5..deb6238416947 100644
---- a/include/soc/fsl/qe/qe.h
-+++ b/include/soc/fsl/qe/qe.h
-@@ -102,26 +102,26 @@ static inline void qe_reset(void) {}
- int cpm_muram_init(void);
- #if defined(CONFIG_CPM) || defined(CONFIG_QUICC_ENGINE)
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
--int cpm_muram_free(unsigned long offset);
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align);
-+int cpm_muram_free(s32 offset);
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
- void __iomem *cpm_muram_addr(unsigned long offset);
- unsigned long cpm_muram_offset(void __iomem *addr);
- dma_addr_t cpm_muram_dma(void __iomem *addr);
- #else
--static inline unsigned long cpm_muram_alloc(unsigned long size,
--                                          unsigned long align)
-+static inline s32 cpm_muram_alloc(unsigned long size,
-+                                unsigned long align)
- {
-       return -ENOSYS;
- }
--static inline int cpm_muram_free(unsigned long offset)
-+static inline int cpm_muram_free(s32 offset)
- {
-       return -ENOSYS;
- }
--static inline unsigned long cpm_muram_alloc_fixed(unsigned long offset,
--                                                unsigned long size)
-+static inline s32 cpm_muram_alloc_fixed(unsigned long offset,
-+                                      unsigned long size)
- {
-       return -ENOSYS;
- }
--- 
-2.20.1
-
index 4e5b3777e9808e8966a8b84bf941cd1cf8bf3d5e..381fc834cc6438fee0c0abdf3233e3bc7149452b 100644 (file)
@@ -16,7 +16,6 @@ scsi-qla2xxx-fix-a-potential-null-pointer-dereference.patch
 revert-kvm-vmx-add-non-canonical-check-on-writes-to-.patch
 drm-gma500-fixup-fbdev-stolen-size-usage-evaluation.patch
 nfsd4-avoid-null-deference-on-strange-copy-compounds.patch
-soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
 cpu-hotplug-stop_machine-fix-stop_machine-vs-hotplug.patch
 brcmfmac-fix-use-after-free-in-brcmf_sdio_readframes.patch
 gianfar-fix-tx-timestamping-with-a-stacked-dsa-drive.patch
diff --git a/queue-4.9/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch b/queue-4.9/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
deleted file mode 100644 (file)
index a125aff..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-From 5e1f645c0954e355aa4c68359f761494fb755a36 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 28 Nov 2019 15:55:40 +0100
-Subject: soc: fsl: qe: change return type of cpm_muram_alloc() to s32
-
-From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-
-[ Upstream commit 800cd6fb76f0ec7711deb72a86c924db1ae42648 ]
-
-There are a number of problems with cpm_muram_alloc() and its
-callers. Most callers assign the return value to some variable and
-then use IS_ERR_VALUE to check for allocation failure. However, when
-that variable is not sizeof(long), this leads to warnings - and it is
-indeed broken to do e.g.
-
-  u32 foo = cpm_muram_alloc();
-  if (IS_ERR_VALUE(foo))
-
-on a 64-bit platform, since the condition
-
-  foo >= (unsigned long)-ENOMEM
-
-is tautologically false. There are also callers that ignore the
-possibility of error, and then there are those that check for error by
-comparing the return value to 0...
-
-One could fix that by changing all callers to store the return value
-temporarily in an "unsigned long" and test that. However, use of
-IS_ERR_VALUE() is error-prone and should be restricted to things which
-are inherently long-sized (stuff in pt_regs etc.). Instead, let's aim
-for changing to the standard kernel style
-
-  int foo = cpm_muram_alloc();
-  if (foo < 0)
-    deal_with_it()
-  some->where = foo;
-
-Changing the return type from unsigned long to s32 (aka signed int)
-doesn't change the value that gets stored into any of the callers'
-variables except if the caller was storing the result in a u64 _and_
-the allocation failed, so in itself this patch should be a no-op.
-
-Another problem with cpm_muram_alloc() is that it can certainly
-validly return 0 - and except if some cpm_muram_alloc_fixed() call
-interferes, the very first cpm_muram_alloc() call will return just
-that. But that shows that both ucc_slow_free() and ucc_fast_free() are
-buggy, since they assume that a value of 0 means "that field was never
-allocated". We'll later change cpm_muram_free() to accept (and ignore)
-a negative offset, so callers can use a sentinel of -1 instead of 0
-and just unconditionally call cpm_muram_free().
-
-Reviewed-by: Timur Tabi <timur@kernel.org>
-Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-Signed-off-by: Li Yang <leoyang.li@nxp.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/soc/fsl/qe/qe_common.c | 29 ++++++++++++++++-------------
- include/soc/fsl/qe/qe.h        | 16 ++++++++--------
- 2 files changed, 24 insertions(+), 21 deletions(-)
-
-diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c
-index 104e68d9b84f2..4f60724b06b7c 100644
---- a/drivers/soc/fsl/qe/qe_common.c
-+++ b/drivers/soc/fsl/qe/qe_common.c
-@@ -35,7 +35,7 @@ static phys_addr_t muram_pbase;
- struct muram_block {
-       struct list_head head;
--      unsigned long start;
-+      s32 start;
-       int size;
- };
-@@ -113,13 +113,14 @@ out_muram:
-  * @algo: algorithm for alloc.
-  * @data: data for genalloc's algorithm.
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  */
--static unsigned long cpm_muram_alloc_common(unsigned long size,
--              genpool_algo_t algo, void *data)
-+static s32 cpm_muram_alloc_common(unsigned long size,
-+                                genpool_algo_t algo, void *data)
- {
-       struct muram_block *entry;
--      unsigned long start;
-+      s32 start;
-       if (!muram_pool && cpm_muram_init())
-               goto out2;
-@@ -140,7 +141,7 @@ static unsigned long cpm_muram_alloc_common(unsigned long size,
- out1:
-       gen_pool_free(muram_pool, start, size);
- out2:
--      return (unsigned long)-ENOMEM;
-+      return -ENOMEM;
- }
- /*
-@@ -148,13 +149,14 @@ out2:
-  * @size: number of bytes to allocate
-  * @align: requested alignment, in bytes
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align)
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_align muram_pool_data;
-@@ -171,7 +173,7 @@ EXPORT_SYMBOL(cpm_muram_alloc);
-  * cpm_muram_free - free a chunk of multi-user ram
-  * @offset: The beginning of the chunk as returned by cpm_muram_alloc().
-  */
--int cpm_muram_free(unsigned long offset)
-+int cpm_muram_free(s32 offset)
- {
-       unsigned long flags;
-       int size;
-@@ -197,13 +199,14 @@ EXPORT_SYMBOL(cpm_muram_free);
-  * cpm_muram_alloc_fixed - reserve a specific region of multi-user ram
-  * @offset: offset of allocation start address
-  * @size: number of bytes to allocate
-- * This function returns an offset into the muram area
-+ * This function returns @offset if the area was available, a negative
-+ * errno otherwise.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_fixed muram_pool_data_fixed;
-diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h
-index 226f915a68c28..55907f7ace82e 100644
---- a/include/soc/fsl/qe/qe.h
-+++ b/include/soc/fsl/qe/qe.h
-@@ -102,26 +102,26 @@ static inline void qe_reset(void) {}
- int cpm_muram_init(void);
- #if defined(CONFIG_CPM) || defined(CONFIG_QUICC_ENGINE)
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
--int cpm_muram_free(unsigned long offset);
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align);
-+int cpm_muram_free(s32 offset);
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
- void __iomem *cpm_muram_addr(unsigned long offset);
- unsigned long cpm_muram_offset(void __iomem *addr);
- dma_addr_t cpm_muram_dma(void __iomem *addr);
- #else
--static inline unsigned long cpm_muram_alloc(unsigned long size,
--                                          unsigned long align)
-+static inline s32 cpm_muram_alloc(unsigned long size,
-+                                unsigned long align)
- {
-       return -ENOSYS;
- }
--static inline int cpm_muram_free(unsigned long offset)
-+static inline int cpm_muram_free(s32 offset)
- {
-       return -ENOSYS;
- }
--static inline unsigned long cpm_muram_alloc_fixed(unsigned long offset,
--                                                unsigned long size)
-+static inline s32 cpm_muram_alloc_fixed(unsigned long offset,
-+                                      unsigned long size)
- {
-       return -ENOSYS;
- }
--- 
-2.20.1
-
index 2953b05042b1c2f5738dfb282f28d90707f5bc2b..d489b6c5199d46afad0c8dde73bfb1e35039b495 100644 (file)
@@ -11,7 +11,6 @@ drm-qxl-complete-exception-handling-in-qxl_device_in.patch
 nfsd4-avoid-null-deference-on-strange-copy-compounds.patch
 rcu-nocb-fix-dump_tree-hierarchy-print-always-active.patch
 rcu-fix-missed-wakeup-of-exp_wq-waiters.patch
-soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
 rcu-fix-data-race-due-to-atomic_t-copy-by-value.patch
 f2fs-preallocate-dio-blocks-when-forcing-buffered_io.patch
 f2fs-call-f2fs_balance_fs-outside-of-locked-page.patch
diff --git a/queue-5.4/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch b/queue-5.4/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
deleted file mode 100644 (file)
index f4c50f7..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-From a621d4c881759e096736128064ac81d02aedb1e5 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 28 Nov 2019 15:55:40 +0100
-Subject: soc: fsl: qe: change return type of cpm_muram_alloc() to s32
-
-From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-
-[ Upstream commit 800cd6fb76f0ec7711deb72a86c924db1ae42648 ]
-
-There are a number of problems with cpm_muram_alloc() and its
-callers. Most callers assign the return value to some variable and
-then use IS_ERR_VALUE to check for allocation failure. However, when
-that variable is not sizeof(long), this leads to warnings - and it is
-indeed broken to do e.g.
-
-  u32 foo = cpm_muram_alloc();
-  if (IS_ERR_VALUE(foo))
-
-on a 64-bit platform, since the condition
-
-  foo >= (unsigned long)-ENOMEM
-
-is tautologically false. There are also callers that ignore the
-possibility of error, and then there are those that check for error by
-comparing the return value to 0...
-
-One could fix that by changing all callers to store the return value
-temporarily in an "unsigned long" and test that. However, use of
-IS_ERR_VALUE() is error-prone and should be restricted to things which
-are inherently long-sized (stuff in pt_regs etc.). Instead, let's aim
-for changing to the standard kernel style
-
-  int foo = cpm_muram_alloc();
-  if (foo < 0)
-    deal_with_it()
-  some->where = foo;
-
-Changing the return type from unsigned long to s32 (aka signed int)
-doesn't change the value that gets stored into any of the callers'
-variables except if the caller was storing the result in a u64 _and_
-the allocation failed, so in itself this patch should be a no-op.
-
-Another problem with cpm_muram_alloc() is that it can certainly
-validly return 0 - and except if some cpm_muram_alloc_fixed() call
-interferes, the very first cpm_muram_alloc() call will return just
-that. But that shows that both ucc_slow_free() and ucc_fast_free() are
-buggy, since they assume that a value of 0 means "that field was never
-allocated". We'll later change cpm_muram_free() to accept (and ignore)
-a negative offset, so callers can use a sentinel of -1 instead of 0
-and just unconditionally call cpm_muram_free().
-
-Reviewed-by: Timur Tabi <timur@kernel.org>
-Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-Signed-off-by: Li Yang <leoyang.li@nxp.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/soc/fsl/qe/qe_common.c | 29 ++++++++++++++++-------------
- include/soc/fsl/qe/qe.h        | 16 ++++++++--------
- 2 files changed, 24 insertions(+), 21 deletions(-)
-
-diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c
-index 83e85e61669f5..84c90105e588b 100644
---- a/drivers/soc/fsl/qe/qe_common.c
-+++ b/drivers/soc/fsl/qe/qe_common.c
-@@ -32,7 +32,7 @@ static phys_addr_t muram_pbase;
- struct muram_block {
-       struct list_head head;
--      unsigned long start;
-+      s32 start;
-       int size;
- };
-@@ -110,13 +110,14 @@ out_muram:
-  * @algo: algorithm for alloc.
-  * @data: data for genalloc's algorithm.
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  */
--static unsigned long cpm_muram_alloc_common(unsigned long size,
--              genpool_algo_t algo, void *data)
-+static s32 cpm_muram_alloc_common(unsigned long size,
-+                                genpool_algo_t algo, void *data)
- {
-       struct muram_block *entry;
--      unsigned long start;
-+      s32 start;
-       if (!muram_pool && cpm_muram_init())
-               goto out2;
-@@ -137,7 +138,7 @@ static unsigned long cpm_muram_alloc_common(unsigned long size,
- out1:
-       gen_pool_free(muram_pool, start, size);
- out2:
--      return (unsigned long)-ENOMEM;
-+      return -ENOMEM;
- }
- /*
-@@ -145,13 +146,14 @@ out2:
-  * @size: number of bytes to allocate
-  * @align: requested alignment, in bytes
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align)
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_align muram_pool_data;
-@@ -168,7 +170,7 @@ EXPORT_SYMBOL(cpm_muram_alloc);
-  * cpm_muram_free - free a chunk of multi-user ram
-  * @offset: The beginning of the chunk as returned by cpm_muram_alloc().
-  */
--int cpm_muram_free(unsigned long offset)
-+int cpm_muram_free(s32 offset)
- {
-       unsigned long flags;
-       int size;
-@@ -194,13 +196,14 @@ EXPORT_SYMBOL(cpm_muram_free);
-  * cpm_muram_alloc_fixed - reserve a specific region of multi-user ram
-  * @offset: offset of allocation start address
-  * @size: number of bytes to allocate
-- * This function returns an offset into the muram area
-+ * This function returns @offset if the area was available, a negative
-+ * errno otherwise.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_fixed muram_pool_data_fixed;
-diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h
-index c1036d16ed03b..2d35d5db16231 100644
---- a/include/soc/fsl/qe/qe.h
-+++ b/include/soc/fsl/qe/qe.h
-@@ -98,26 +98,26 @@ static inline void qe_reset(void) {}
- int cpm_muram_init(void);
- #if defined(CONFIG_CPM) || defined(CONFIG_QUICC_ENGINE)
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
--int cpm_muram_free(unsigned long offset);
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align);
-+int cpm_muram_free(s32 offset);
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
- void __iomem *cpm_muram_addr(unsigned long offset);
- unsigned long cpm_muram_offset(void __iomem *addr);
- dma_addr_t cpm_muram_dma(void __iomem *addr);
- #else
--static inline unsigned long cpm_muram_alloc(unsigned long size,
--                                          unsigned long align)
-+static inline s32 cpm_muram_alloc(unsigned long size,
-+                                unsigned long align)
- {
-       return -ENOSYS;
- }
--static inline int cpm_muram_free(unsigned long offset)
-+static inline int cpm_muram_free(s32 offset)
- {
-       return -ENOSYS;
- }
--static inline unsigned long cpm_muram_alloc_fixed(unsigned long offset,
--                                                unsigned long size)
-+static inline s32 cpm_muram_alloc_fixed(unsigned long offset,
-+                                      unsigned long size)
- {
-       return -ENOSYS;
- }
--- 
-2.20.1
-
index 7b0700d8503e2d9e39f18806abfa88a3a17aa77f..060260fd7eb22e8535deaae7b27c701528b23a5f 100644 (file)
@@ -13,7 +13,6 @@ drm-qxl-complete-exception-handling-in-qxl_device_in.patch
 nfsd4-avoid-null-deference-on-strange-copy-compounds.patch
 rcu-nocb-fix-dump_tree-hierarchy-print-always-active.patch
 rcu-fix-missed-wakeup-of-exp_wq-waiters.patch
-soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
 rcu-fix-data-race-due-to-atomic_t-copy-by-value.patch
 dmaengine-ti-edma-add-missed-operations.patch
 f2fs-preallocate-dio-blocks-when-forcing-buffered_io.patch
diff --git a/queue-5.5/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch b/queue-5.5/soc-fsl-qe-change-return-type-of-cpm_muram_alloc-to-.patch
deleted file mode 100644 (file)
index 0af2f25..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-From bb2933e84815dcc39d555f2746ffef8665dddbc8 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 28 Nov 2019 15:55:40 +0100
-Subject: soc: fsl: qe: change return type of cpm_muram_alloc() to s32
-
-From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-
-[ Upstream commit 800cd6fb76f0ec7711deb72a86c924db1ae42648 ]
-
-There are a number of problems with cpm_muram_alloc() and its
-callers. Most callers assign the return value to some variable and
-then use IS_ERR_VALUE to check for allocation failure. However, when
-that variable is not sizeof(long), this leads to warnings - and it is
-indeed broken to do e.g.
-
-  u32 foo = cpm_muram_alloc();
-  if (IS_ERR_VALUE(foo))
-
-on a 64-bit platform, since the condition
-
-  foo >= (unsigned long)-ENOMEM
-
-is tautologically false. There are also callers that ignore the
-possibility of error, and then there are those that check for error by
-comparing the return value to 0...
-
-One could fix that by changing all callers to store the return value
-temporarily in an "unsigned long" and test that. However, use of
-IS_ERR_VALUE() is error-prone and should be restricted to things which
-are inherently long-sized (stuff in pt_regs etc.). Instead, let's aim
-for changing to the standard kernel style
-
-  int foo = cpm_muram_alloc();
-  if (foo < 0)
-    deal_with_it()
-  some->where = foo;
-
-Changing the return type from unsigned long to s32 (aka signed int)
-doesn't change the value that gets stored into any of the callers'
-variables except if the caller was storing the result in a u64 _and_
-the allocation failed, so in itself this patch should be a no-op.
-
-Another problem with cpm_muram_alloc() is that it can certainly
-validly return 0 - and except if some cpm_muram_alloc_fixed() call
-interferes, the very first cpm_muram_alloc() call will return just
-that. But that shows that both ucc_slow_free() and ucc_fast_free() are
-buggy, since they assume that a value of 0 means "that field was never
-allocated". We'll later change cpm_muram_free() to accept (and ignore)
-a negative offset, so callers can use a sentinel of -1 instead of 0
-and just unconditionally call cpm_muram_free().
-
-Reviewed-by: Timur Tabi <timur@kernel.org>
-Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-Signed-off-by: Li Yang <leoyang.li@nxp.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/soc/fsl/qe/qe_common.c | 29 ++++++++++++++++-------------
- include/soc/fsl/qe/qe.h        | 16 ++++++++--------
- 2 files changed, 24 insertions(+), 21 deletions(-)
-
-diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c
-index 83e85e61669f5..84c90105e588b 100644
---- a/drivers/soc/fsl/qe/qe_common.c
-+++ b/drivers/soc/fsl/qe/qe_common.c
-@@ -32,7 +32,7 @@ static phys_addr_t muram_pbase;
- struct muram_block {
-       struct list_head head;
--      unsigned long start;
-+      s32 start;
-       int size;
- };
-@@ -110,13 +110,14 @@ out_muram:
-  * @algo: algorithm for alloc.
-  * @data: data for genalloc's algorithm.
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  */
--static unsigned long cpm_muram_alloc_common(unsigned long size,
--              genpool_algo_t algo, void *data)
-+static s32 cpm_muram_alloc_common(unsigned long size,
-+                                genpool_algo_t algo, void *data)
- {
-       struct muram_block *entry;
--      unsigned long start;
-+      s32 start;
-       if (!muram_pool && cpm_muram_init())
-               goto out2;
-@@ -137,7 +138,7 @@ static unsigned long cpm_muram_alloc_common(unsigned long size,
- out1:
-       gen_pool_free(muram_pool, start, size);
- out2:
--      return (unsigned long)-ENOMEM;
-+      return -ENOMEM;
- }
- /*
-@@ -145,13 +146,14 @@ out2:
-  * @size: number of bytes to allocate
-  * @align: requested alignment, in bytes
-  *
-- * This function returns an offset into the muram area.
-+ * This function returns a non-negative offset into the muram area, or
-+ * a negative errno on failure.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align)
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_align muram_pool_data;
-@@ -168,7 +170,7 @@ EXPORT_SYMBOL(cpm_muram_alloc);
-  * cpm_muram_free - free a chunk of multi-user ram
-  * @offset: The beginning of the chunk as returned by cpm_muram_alloc().
-  */
--int cpm_muram_free(unsigned long offset)
-+int cpm_muram_free(s32 offset)
- {
-       unsigned long flags;
-       int size;
-@@ -194,13 +196,14 @@ EXPORT_SYMBOL(cpm_muram_free);
-  * cpm_muram_alloc_fixed - reserve a specific region of multi-user ram
-  * @offset: offset of allocation start address
-  * @size: number of bytes to allocate
-- * This function returns an offset into the muram area
-+ * This function returns @offset if the area was available, a negative
-+ * errno otherwise.
-  * Use cpm_dpram_addr() to get the virtual address of the area.
-  * Use cpm_muram_free() to free the allocation.
-  */
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
- {
--      unsigned long start;
-+      s32 start;
-       unsigned long flags;
-       struct genpool_data_fixed muram_pool_data_fixed;
-diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h
-index c1036d16ed03b..2d35d5db16231 100644
---- a/include/soc/fsl/qe/qe.h
-+++ b/include/soc/fsl/qe/qe.h
-@@ -98,26 +98,26 @@ static inline void qe_reset(void) {}
- int cpm_muram_init(void);
- #if defined(CONFIG_CPM) || defined(CONFIG_QUICC_ENGINE)
--unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
--int cpm_muram_free(unsigned long offset);
--unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
-+s32 cpm_muram_alloc(unsigned long size, unsigned long align);
-+int cpm_muram_free(s32 offset);
-+s32 cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
- void __iomem *cpm_muram_addr(unsigned long offset);
- unsigned long cpm_muram_offset(void __iomem *addr);
- dma_addr_t cpm_muram_dma(void __iomem *addr);
- #else
--static inline unsigned long cpm_muram_alloc(unsigned long size,
--                                          unsigned long align)
-+static inline s32 cpm_muram_alloc(unsigned long size,
-+                                unsigned long align)
- {
-       return -ENOSYS;
- }
--static inline int cpm_muram_free(unsigned long offset)
-+static inline int cpm_muram_free(s32 offset)
- {
-       return -ENOSYS;
- }
--static inline unsigned long cpm_muram_alloc_fixed(unsigned long offset,
--                                                unsigned long size)
-+static inline s32 cpm_muram_alloc_fixed(unsigned long offset,
-+                                      unsigned long size)
- {
-       return -ENOSYS;
- }
--- 
-2.20.1
-