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
+++ /dev/null
-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
-
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
+++ /dev/null
-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
-
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
+++ /dev/null
-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
-
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
+++ /dev/null
-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
-
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
+++ /dev/null
-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
-