* linux-next: manual merge of the bitmap tree with the random tree
@ 2022-07-26 8:56 Stephen Rothwell
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2022-07-26 8:56 UTC (permalink / raw)
To: Yury Norov, Theodore Ts'o, Jason A. Donenfeld
Cc: Linux Kernel Mailing List, Linux Next Mailing List,
Michael Ellerman
[-- Attachment #1: Type: text/plain, Size: 3524 bytes --]
Hi all,
Today's linux-next merge of the bitmap tree got a conflict in:
arch/powerpc/include/asm/archrandom.h
between commits:
9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM")
d349ab99eec7 ("random: handle archrandom with multiple longs")
from the random tree and commit:
2f9905799751 ("powerpc: drop dependency on <asm/machdep.h> in archrandom.h")
from the bitmap tree.
I fixed it up (see bottom and also applied the following merge fix patch)
and can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging. You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 26 Jul 2022 18:47:56 +1000
Subject: [PATCH] fix up for "powerpc: drop dependency on <asm/machdep.h> in archrandom.h"
interacting with "random: handle archrandom with multiple longs" and
"random: remove CONFIG_ARCH_RANDOM"
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/kernel/setup-common.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 194d09461767..409a0a763fe4 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -171,16 +171,13 @@ EXPORT_SYMBOL_GPL(machine_power_off);
void (*pm_power_off)(void);
EXPORT_SYMBOL_GPL(pm_power_off);
-#ifdef CONFIG_ARCH_RANDOM
-bool __must_check arch_get_random_seed_long(unsigned long *v)
+size_t arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
{
- if (ppc_md.get_random_seed)
- return ppc_md.get_random_seed(v);
-
- return false;
+ if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
+ return 1;
+ return 0;
}
-EXPORT_SYMBOL(arch_get_random_seed_long);
-#endif
+EXPORT_SYMBOL(arch_get_random_seed_longs);
void machine_halt(void)
{
--
2.35.1
--
Cheers,
Stephen Rothwell
diff --cc arch/powerpc/include/asm/archrandom.h
index 0e365c5b2396,21def59ef1a6..c94c9d782533
--- a/arch/powerpc/include/asm/archrandom.h
+++ b/arch/powerpc/include/asm/archrandom.h
@@@ -2,19 -2,33 +2,12 @@@
#ifndef _ASM_POWERPC_ARCHRANDOM_H
#define _ASM_POWERPC_ARCHRANDOM_H
- #include <asm/machdep.h>
-#ifdef CONFIG_ARCH_RANDOM
-
-bool __must_check arch_get_random_seed_long(unsigned long *v);
-
-static inline bool __must_check arch_get_random_long(unsigned long *v)
-{
- return false;
-}
--
-static inline bool __must_check arch_get_random_int(unsigned int *v)
+static inline size_t __must_check arch_get_random_longs(unsigned long *v, size_t max_longs)
{
- return false;
+ return 0;
}
- static inline size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
-
-static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
--{
- if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
- return 1;
- return 0;
- unsigned long val;
- bool rc;
-
- rc = arch_get_random_seed_long(&val);
- if (rc)
- *v = val;
-
- return rc;
--}
-#endif /* CONFIG_ARCH_RANDOM */
++size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs);
#ifdef CONFIG_PPC_POWERNV
int powernv_hwrng_present(void);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* linux-next: manual merge of the bitmap tree with the random tree
@ 2022-08-02 23:59 broonie
2022-08-06 5:40 ` Michael Ellerman
0 siblings, 1 reply; 6+ messages in thread
From: broonie @ 2022-08-02 23:59 UTC (permalink / raw)
To: Yury Norov
Cc: Jason A . Donenfeld, Linux Kernel Mailing List,
Linux Next Mailing List
Hi all,
Today's linux-next merge of the bitmap tree got a conflict in:
arch/powerpc/include/asm/archrandom.h
between commit:
d349ab99eec7a ("random: handle archrandom with multiple longs")
from the random tree and commit:
3e731203153de ("powerpc: drop dependency on <asm/machdep.h> in archrandom.h")
from the bitmap tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc arch/powerpc/include/asm/archrandom.h
index 564859e6a807c,21def59ef1a68..0000000000000
--- a/arch/powerpc/include/asm/archrandom.h
+++ b/arch/powerpc/include/asm/archrandom.h
@@@ -2,22 -2,41 +2,17 @@@
#ifndef _ASM_POWERPC_ARCHRANDOM_H
#define _ASM_POWERPC_ARCHRANDOM_H
-#ifdef CONFIG_ARCH_RANDOM
+#include <asm/machdep.h>
-bool __must_check arch_get_random_seed_long(unsigned long *v);
-
-static inline bool __must_check arch_get_random_long(unsigned long *v)
+static inline size_t __must_check arch_get_random_longs(unsigned long *v, size_t max_longs)
{
- return false;
+ return 0;
}
- static inline size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
-static inline bool __must_check arch_get_random_int(unsigned int *v)
--{
- if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
- return 1;
- return 0;
- return false;
-}
-
-
-static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
-{
- unsigned long val;
- bool rc;
-
- rc = arch_get_random_seed_long(&val);
- if (rc)
- *v = val;
-
- return rc;
--}
-#endif /* CONFIG_ARCH_RANDOM */
++size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs);
#ifdef CONFIG_PPC_POWERNV
-int powernv_hwrng_present(void);
-int powernv_get_random_long(unsigned long *v);
-int powernv_get_random_real_mode(unsigned long *v);
-#else
-static inline int powernv_hwrng_present(void) { return 0; }
-static inline int powernv_get_random_real_mode(unsigned long *v) { return 0; }
+int pnv_get_random_long(unsigned long *v);
#endif
#endif /* _ASM_POWERPC_ARCHRANDOM_H */
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 3b1cf9ca4814b..951822145600e 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -172,12 +172,12 @@ void (*pm_power_off)(void);
EXPORT_SYMBOL_GPL(pm_power_off);
#ifdef CONFIG_ARCH_RANDOM
-bool __must_check arch_get_random_seed_long(unsigned long *v)
+size_T __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
{
- if (ppc_md.get_random_seed)
- return ppc_md.get_random_seed(v);
+ if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
+ return 1;
- return false;
+ return 0;
}
EXPORT_SYMBOL(arch_get_random_seed_long);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: linux-next: manual merge of the bitmap tree with the random tree
2022-08-02 23:59 broonie
@ 2022-08-06 5:40 ` Michael Ellerman
0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2022-08-06 5:40 UTC (permalink / raw)
To: broonie, Yury Norov, Linus Torvalds
Cc: Jason A . Donenfeld, Linux Kernel Mailing List,
Linux Next Mailing List
Hi Mark,
Thanks for doing linux-next in sfr's absence.
The merge resolution below is not quite right ...
broonie@kernel.org writes:
> Hi all,
>
> Today's linux-next merge of the bitmap tree got a conflict in:
>
> arch/powerpc/include/asm/archrandom.h
>
> between commit:
>
> d349ab99eec7a ("random: handle archrandom with multiple longs")
>
> from the random tree and commit:
>
> 3e731203153de ("powerpc: drop dependency on <asm/machdep.h> in archrandom.h")
>
> from the bitmap tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> diff --cc arch/powerpc/include/asm/archrandom.h
> index 564859e6a807c,21def59ef1a68..0000000000000
> --- a/arch/powerpc/include/asm/archrandom.h
> +++ b/arch/powerpc/include/asm/archrandom.h
> @@@ -2,22 -2,41 +2,17 @@@
> #ifndef _ASM_POWERPC_ARCHRANDOM_H
> #define _ASM_POWERPC_ARCHRANDOM_H
>
> -#ifdef CONFIG_ARCH_RANDOM
> +#include <asm/machdep.h>
This include must be dropped.
> -bool __must_check arch_get_random_seed_long(unsigned long *v);
> -
> -static inline bool __must_check arch_get_random_long(unsigned long *v)
> +static inline size_t __must_check arch_get_random_longs(unsigned long *v, size_t max_longs)
> {
> - return false;
> + return 0;
> }
>
> - static inline size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
> -static inline bool __must_check arch_get_random_int(unsigned int *v)
> --{
> - if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
> - return 1;
> - return 0;
> - return false;
> -}
> -
> -
> -static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
> -{
> - unsigned long val;
> - bool rc;
> -
> - rc = arch_get_random_seed_long(&val);
> - if (rc)
> - *v = val;
> -
> - return rc;
> --}
> -#endif /* CONFIG_ARCH_RANDOM */
> ++size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs);
>
> #ifdef CONFIG_PPC_POWERNV
> -int powernv_hwrng_present(void);
> -int powernv_get_random_long(unsigned long *v);
> -int powernv_get_random_real_mode(unsigned long *v);
> -#else
> -static inline int powernv_hwrng_present(void) { return 0; }
> -static inline int powernv_get_random_real_mode(unsigned long *v) { return 0; }
> +int pnv_get_random_long(unsigned long *v);
> #endif
>
> #endif /* _ASM_POWERPC_ARCHRANDOM_H */
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index 3b1cf9ca4814b..951822145600e 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -172,12 +172,12 @@ void (*pm_power_off)(void);
> EXPORT_SYMBOL_GPL(pm_power_off);
>
> #ifdef CONFIG_ARCH_RANDOM
This ifdef must be dropped entirely, it was removed in Jason's tree.
> -bool __must_check arch_get_random_seed_long(unsigned long *v)
> +size_T __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
Typo, should be size_t.
> {
> - if (ppc_md.get_random_seed)
> - return ppc_md.get_random_seed(v);
> + if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
> + return 1;
>
> - return false;
> + return 0;
> }
> EXPORT_SYMBOL(arch_get_random_seed_long);
The export needs to be updated to "arch_get_random_seed_longs".
I've attached the end state of archrandom.h and the hunk in
setup-common.c below for reference.
cheers
==== arch/powerpc/kernel/setup-common.c ====
...
size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
{
if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
return 1;
return 0;
}
EXPORT_SYMBOL(arch_get_random_seed_longs);
...
==== arch/powerpc/include/asm/archrandom.h ====
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_POWERPC_ARCHRANDOM_H
#define _ASM_POWERPC_ARCHRANDOM_H
static inline size_t __must_check arch_get_random_longs(unsigned long *v, size_t max_longs)
{
return 0;
}
size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs);
#ifdef CONFIG_PPC_POWERNV
int pnv_get_random_long(unsigned long *v);
#endif
#endif /* _ASM_POWERPC_ARCHRANDOM_H */
^ permalink raw reply [flat|nested] 6+ messages in thread
* linux-next: manual merge of the bitmap tree with the random tree
@ 2022-10-07 5:14 Stephen Rothwell
2022-10-11 21:46 ` Stephen Rothwell
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2022-10-07 5:14 UTC (permalink / raw)
To: Yury Norov, Theodore Ts'o, Jason A. Donenfeld
Cc: Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]
Hi all,
Today's linux-next merge of the bitmap tree got a conflict in:
include/linux/nodemask.h
between commit:
82f33a32b4d2 ("treewide: use prandom_u32_max() when possible")
from the random tree and commit:
97848c10f9f8 ("lib/bitmap: remove bitmap_ord_to_pos")
from the bitmap tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc include/linux/nodemask.h
index 66ee9b4b7925,0c45fb066caa..000000000000
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@@ -508,8 -508,7 +508,7 @@@ static inline int node_random(const nod
w = nodes_weight(*maskp);
if (w)
- bit = bitmap_ord_to_pos(maskp->bits,
- prandom_u32_max(w), MAX_NUMNODES);
- bit = find_nth_bit(maskp->bits, MAX_NUMNODES, get_random_int() % w);
++ bit = find_nth_bit(maskp->bits, MAX_NUMNODES, prandom_u32_max(w));
return bit;
#else
return 0;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: linux-next: manual merge of the bitmap tree with the random tree
2022-10-07 5:14 Stephen Rothwell
@ 2022-10-11 21:46 ` Stephen Rothwell
2022-10-11 23:33 ` Jason A. Donenfeld
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2022-10-11 21:46 UTC (permalink / raw)
To: Theodore Ts'o, Jason A. Donenfeld
Cc: Yury Norov, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]
Hi all,
On Fri, 7 Oct 2022 16:14:11 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the bitmap tree got a conflict in:
>
> include/linux/nodemask.h
>
> between commit:
>
> 82f33a32b4d2 ("treewide: use prandom_u32_max() when possible")
>
> from the random tree and commit:
>
> 97848c10f9f8 ("lib/bitmap: remove bitmap_ord_to_pos")
>
> from the bitmap tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
>
> diff --cc include/linux/nodemask.h
> index 66ee9b4b7925,0c45fb066caa..000000000000
> --- a/include/linux/nodemask.h
> +++ b/include/linux/nodemask.h
> @@@ -508,8 -508,7 +508,7 @@@ static inline int node_random(const nod
>
> w = nodes_weight(*maskp);
> if (w)
> - bit = bitmap_ord_to_pos(maskp->bits,
> - prandom_u32_max(w), MAX_NUMNODES);
> - bit = find_nth_bit(maskp->bits, MAX_NUMNODES, get_random_int() % w);
> ++ bit = find_nth_bit(maskp->bits, MAX_NUMNODES, prandom_u32_max(w));
> return bit;
> #else
> return 0;
This is now a conflict between the random tree and Linus' tree.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: linux-next: manual merge of the bitmap tree with the random tree
2022-10-11 21:46 ` Stephen Rothwell
@ 2022-10-11 23:33 ` Jason A. Donenfeld
0 siblings, 0 replies; 6+ messages in thread
From: Jason A. Donenfeld @ 2022-10-11 23:33 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Theodore Ts'o, Yury Norov, Linux Kernel Mailing List,
Linux Next Mailing List
On Tue, Oct 11, 2022 at 5:32 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> On Fri, 7 Oct 2022 16:14:11 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next merge of the bitmap tree got a conflict in:
> >
> > include/linux/nodemask.h
> >
> > between commit:
> >
> > 82f33a32b4d2 ("treewide: use prandom_u32_max() when possible")
> >
> > from the random tree and commit:
> >
> > 97848c10f9f8 ("lib/bitmap: remove bitmap_ord_to_pos")
> >
> > from the bitmap tree.
> >
> > I fixed it up (see below) and can carry the fix as necessary. This
> > is now fixed as far as linux-next is concerned, but any non trivial
> > conflicts should be mentioned to your upstream maintainer when your tree
> > is submitted for merging. You may also want to consider cooperating
> > with the maintainer of the conflicting tree to minimise any particularly
> > complex conflicts.
> >
> >
> > diff --cc include/linux/nodemask.h
> > index 66ee9b4b7925,0c45fb066caa..000000000000
> > --- a/include/linux/nodemask.h
> > +++ b/include/linux/nodemask.h
> > @@@ -508,8 -508,7 +508,7 @@@ static inline int node_random(const nod
> >
> > w = nodes_weight(*maskp);
> > if (w)
> > - bit = bitmap_ord_to_pos(maskp->bits,
> > - prandom_u32_max(w), MAX_NUMNODES);
> > - bit = find_nth_bit(maskp->bits, MAX_NUMNODES, get_random_int() % w);
> > ++ bit = find_nth_bit(maskp->bits, MAX_NUMNODES, prandom_u32_max(w));
> > return bit;
> > #else
> > return 0;
>
> This is now a conflict between the random tree and Linus' tree.
Thanks. I'll sort it out.
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-10-11 23:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-26 8:56 linux-next: manual merge of the bitmap tree with the random tree Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2022-08-02 23:59 broonie
2022-08-06 5:40 ` Michael Ellerman
2022-10-07 5:14 Stephen Rothwell
2022-10-11 21:46 ` Stephen Rothwell
2022-10-11 23:33 ` Jason A. Donenfeld
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).