* [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms @ 2019-01-29 21:46 Nathan Chancellor 2019-01-30 5:20 ` Liang Yang ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: Nathan Chancellor @ 2019-01-29 21:46 UTC (permalink / raw) To: Liang Yang, Boris Brezillon, Miquel Raynal Cc: Richard Weinberger, linux-kernel, linux-mtd, Kevin Hilman, linux-amlogic, Nathan Chancellor, linux-arm-kernel On arm little endian allyesconfig: ld.lld: error: undefined symbol: __aeabi_uldivmod >>> referenced by meson_nand.c >>> mtd/nand/raw/meson_nand.o:(meson_nfc_setup_data_interface) in archive drivers/built-in.a The dividend tBERS_max is u64, meaning we need to use DIV_ROUND_UP_ULL (which wraps do_div) to prevent the compiler from emitting __aebi_uldivmod. Fixes: 2d570b34b41a ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> --- drivers/mtd/nand/raw/meson_nand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index e858d58d97b0..6f12a96195d1 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1116,8 +1116,8 @@ int meson_nfc_setup_data_interface(struct nand_chip *nand, int csline, div * NFC_CLK_CYCLE); meson_chip->tadl = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tADL_min), div * NFC_CLK_CYCLE); - tbers_clocks = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tBERS_max), - div * NFC_CLK_CYCLE); + tbers_clocks = DIV_ROUND_UP_ULL(PSEC_TO_NSEC(timings->tBERS_max), + div * NFC_CLK_CYCLE); meson_chip->tbers_max = ilog2(tbers_clocks); if (!is_power_of_2(tbers_clocks)) meson_chip->tbers_max++; -- 2.20.1 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms 2019-01-29 21:46 [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms Nathan Chancellor @ 2019-01-30 5:20 ` Liang Yang 2019-01-30 9:26 ` Liang Yang 2019-02-05 19:06 ` Miquel Raynal 2 siblings, 0 replies; 7+ messages in thread From: Liang Yang @ 2019-01-30 5:20 UTC (permalink / raw) To: Nathan Chancellor, Boris Brezillon, Miquel Raynal Cc: Richard Weinberger, linux-kernel, linux-mtd, Kevin Hilman, linux-amlogic, linux-arm-kernel Hello Nathan, On 2019/1/30 5:46, Nathan Chancellor wrote: > On arm little endian allyesconfig: > > ld.lld: error: undefined symbol: __aeabi_uldivmod > >>> referenced by meson_nand.c > >>> mtd/nand/raw/meson_nand.o:(meson_nfc_setup_data_interface) in archive drivers/built-in.a > > The dividend tBERS_max is u64, meaning we need to use DIV_ROUND_UP_ULL > (which wraps do_div) to prevent the compiler from emitting > __aebi_uldivmod. > ok. thanks for your time. > Fixes: 2d570b34b41a ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index e858d58d97b0..6f12a96195d1 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1116,8 +1116,8 @@ int meson_nfc_setup_data_interface(struct nand_chip *nand, int csline, > div * NFC_CLK_CYCLE); > meson_chip->tadl = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tADL_min), > div * NFC_CLK_CYCLE); > - tbers_clocks = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tBERS_max), > - div * NFC_CLK_CYCLE); > + tbers_clocks = DIV_ROUND_UP_ULL(PSEC_TO_NSEC(timings->tBERS_max), > + div * NFC_CLK_CYCLE); ok. > meson_chip->tbers_max = ilog2(tbers_clocks); > if (!is_power_of_2(tbers_clocks)) > meson_chip->tbers_max++; > _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms 2019-01-29 21:46 [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms Nathan Chancellor 2019-01-30 5:20 ` Liang Yang @ 2019-01-30 9:26 ` Liang Yang 2019-01-30 9:32 ` Miquel Raynal 2019-02-05 19:06 ` Miquel Raynal 2 siblings, 1 reply; 7+ messages in thread From: Liang Yang @ 2019-01-30 9:26 UTC (permalink / raw) To: Nathan Chancellor, Boris Brezillon, Miquel Raynal Cc: Richard Weinberger, linux-kernel, linux-mtd, Kevin Hilman, linux-amlogic, linux-arm-kernel Hi Nathan, On 2019/1/30 5:46, Nathan Chancellor wrote: > On arm little endian allyesconfig: > > ld.lld: error: undefined symbol: __aeabi_uldivmod > >>> referenced by meson_nand.c > >>> mtd/nand/raw/meson_nand.o:(meson_nfc_setup_data_interface) in archive drivers/built-in.a > > The dividend tBERS_max is u64, meaning we need to use DIV_ROUND_UP_ULL > (which wraps do_div) to prevent the compiler from emitting > __aebi_uldivmod. > > Fixes: 2d570b34b41a ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index e858d58d97b0..6f12a96195d1 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1116,8 +1116,8 @@ int meson_nfc_setup_data_interface(struct nand_chip *nand, int csline, > div * NFC_CLK_CYCLE); > meson_chip->tadl = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tADL_min), > div * NFC_CLK_CYCLE); > - tbers_clocks = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tBERS_max), > - div * NFC_CLK_CYCLE); > + tbers_clocks = DIV_ROUND_UP_ULL(PSEC_TO_NSEC(timings->tBERS_max), > + div * NFC_CLK_CYCLE); Looks good to me: Acked-by: Liang Yang <liang.yang@amlogic.com> > meson_chip->tbers_max = ilog2(tbers_clocks); > if (!is_power_of_2(tbers_clocks)) > meson_chip->tbers_max++; > _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms 2019-01-30 9:26 ` Liang Yang @ 2019-01-30 9:32 ` Miquel Raynal 2019-01-30 15:27 ` Nathan Chancellor 0 siblings, 1 reply; 7+ messages in thread From: Miquel Raynal @ 2019-01-30 9:32 UTC (permalink / raw) To: Liang Yang Cc: Boris Brezillon, Richard Weinberger, linux-kernel, linux-mtd, Kevin Hilman, linux-amlogic, Nathan Chancellor, linux-arm-kernel Hi Liang, Nathan, Liang Yang <liang.yang@amlogic.com> wrote on Wed, 30 Jan 2019 17:26:39 +0800: > Hi Nathan, > > On 2019/1/30 5:46, Nathan Chancellor wrote: > > On arm little endian allyesconfig: > > > > ld.lld: error: undefined symbol: __aeabi_uldivmod > > >>> referenced by meson_nand.c > > >>> mtd/nand/raw/meson_nand.o:(meson_nfc_setup_data_interface) in archive drivers/built-in.a > > > > The dividend tBERS_max is u64, meaning we need to use DIV_ROUND_UP_ULL > > (which wraps do_div) to prevent the compiler from emitting > > __aebi_uldivmod. > > > > Fixes: 2d570b34b41a ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") > > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> > > --- > > drivers/mtd/nand/raw/meson_nand.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > index e858d58d97b0..6f12a96195d1 100644 > > --- a/drivers/mtd/nand/raw/meson_nand.c > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > @@ -1116,8 +1116,8 @@ int meson_nfc_setup_data_interface(struct nand_chip *nand, int csline, > > div * NFC_CLK_CYCLE); > > meson_chip->tadl = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tADL_min), > > div * NFC_CLK_CYCLE); > > - tbers_clocks = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tBERS_max), > > - div * NFC_CLK_CYCLE); > > + tbers_clocks = DIV_ROUND_UP_ULL(PSEC_TO_NSEC(timings->tBERS_max), > > + div * NFC_CLK_CYCLE); > > Looks good to me: > > Acked-by: Liang Yang <liang.yang@amlogic.com> This is nand/next material, so if you don't mind I would like to squash this fix into the original commit inserting the driver. Thanks, Miquèl _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms 2019-01-30 9:32 ` Miquel Raynal @ 2019-01-30 15:27 ` Nathan Chancellor 2019-01-31 2:42 ` Liang Yang 0 siblings, 1 reply; 7+ messages in thread From: Nathan Chancellor @ 2019-01-30 15:27 UTC (permalink / raw) To: Miquel Raynal Cc: Boris Brezillon, Richard Weinberger, linux-kernel, Liang Yang, linux-mtd, Kevin Hilman, linux-amlogic, linux-arm-kernel On Wed, Jan 30, 2019 at 10:32:20AM +0100, Miquel Raynal wrote: > Hi Liang, Nathan, > > Liang Yang <liang.yang@amlogic.com> wrote on Wed, 30 Jan 2019 17:26:39 > +0800: > > > Hi Nathan, > > > > On 2019/1/30 5:46, Nathan Chancellor wrote: > > > On arm little endian allyesconfig: > > > > > > ld.lld: error: undefined symbol: __aeabi_uldivmod > > > >>> referenced by meson_nand.c > > > >>> mtd/nand/raw/meson_nand.o:(meson_nfc_setup_data_interface) in archive drivers/built-in.a > > > > > > The dividend tBERS_max is u64, meaning we need to use DIV_ROUND_UP_ULL > > > (which wraps do_div) to prevent the compiler from emitting > > > __aebi_uldivmod. > > > > > > Fixes: 2d570b34b41a ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") > > > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> > > > --- > > > drivers/mtd/nand/raw/meson_nand.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > > index e858d58d97b0..6f12a96195d1 100644 > > > --- a/drivers/mtd/nand/raw/meson_nand.c > > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > > @@ -1116,8 +1116,8 @@ int meson_nfc_setup_data_interface(struct nand_chip *nand, int csline, > > > div * NFC_CLK_CYCLE); > > > meson_chip->tadl = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tADL_min), > > > div * NFC_CLK_CYCLE); > > > - tbers_clocks = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tBERS_max), > > > - div * NFC_CLK_CYCLE); > > > + tbers_clocks = DIV_ROUND_UP_ULL(PSEC_TO_NSEC(timings->tBERS_max), > > > + div * NFC_CLK_CYCLE); > > > > Looks good to me: > > > > Acked-by: Liang Yang <liang.yang@amlogic.com> > > This is nand/next material, so if you don't mind I would like to squash > this fix into the original commit inserting the driver. > > > Thanks, > Miquèl Hi Miquel, That is totally fine by me, thanks for the quick response! Nathan _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms 2019-01-30 15:27 ` Nathan Chancellor @ 2019-01-31 2:42 ` Liang Yang 0 siblings, 0 replies; 7+ messages in thread From: Liang Yang @ 2019-01-31 2:42 UTC (permalink / raw) To: Nathan Chancellor, Miquel Raynal Cc: Boris Brezillon, Richard Weinberger, linux-kernel, linux-mtd, Kevin Hilman, linux-amlogic, linux-arm-kernel Hi Miquel, Nathan, On 2019/1/30 23:27, Nathan Chancellor wrote: > On Wed, Jan 30, 2019 at 10:32:20AM +0100, Miquel Raynal wrote: >> Hi Liang, Nathan, >> >> Liang Yang <liang.yang@amlogic.com> wrote on Wed, 30 Jan 2019 17:26:39 >> +0800: >> >>> Hi Nathan, >>> >>> On 2019/1/30 5:46, Nathan Chancellor wrote: >>>> On arm little endian allyesconfig: >>>> >>>> ld.lld: error: undefined symbol: __aeabi_uldivmod >>>> >>> referenced by meson_nand.c >>>> >>> mtd/nand/raw/meson_nand.o:(meson_nfc_setup_data_interface) in archive drivers/built-in.a >>>> >>>> The dividend tBERS_max is u64, meaning we need to use DIV_ROUND_UP_ULL >>>> (which wraps do_div) to prevent the compiler from emitting >>>> __aebi_uldivmod. >>>> >>>> Fixes: 2d570b34b41a ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") >>>> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> >>>> --- >>>> drivers/mtd/nand/raw/meson_nand.c | 4 ++-- >>>> 1 file changed, 2 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c >>>> index e858d58d97b0..6f12a96195d1 100644 >>>> --- a/drivers/mtd/nand/raw/meson_nand.c >>>> +++ b/drivers/mtd/nand/raw/meson_nand.c >>>> @@ -1116,8 +1116,8 @@ int meson_nfc_setup_data_interface(struct nand_chip *nand, int csline, >>>> div * NFC_CLK_CYCLE); >>>> meson_chip->tadl = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tADL_min), >>>> div * NFC_CLK_CYCLE); >>>> - tbers_clocks = DIV_ROUND_UP(PSEC_TO_NSEC(timings->tBERS_max), >>>> - div * NFC_CLK_CYCLE); >>>> + tbers_clocks = DIV_ROUND_UP_ULL(PSEC_TO_NSEC(timings->tBERS_max), >>>> + div * NFC_CLK_CYCLE); >>> >>> Looks good to me: >>> >>> Acked-by: Liang Yang <liang.yang@amlogic.com> >> >> This is nand/next material, so if you don't mind I would like to squash >> this fix into the original commit inserting the driver. >> >> >> Thanks, >> Miquèl > > Hi Miquel, > > That is totally fine by me, thanks for the quick response! > > Nathan > it is ok with me. > . > _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms 2019-01-29 21:46 [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms Nathan Chancellor 2019-01-30 5:20 ` Liang Yang 2019-01-30 9:26 ` Liang Yang @ 2019-02-05 19:06 ` Miquel Raynal 2 siblings, 0 replies; 7+ messages in thread From: Miquel Raynal @ 2019-02-05 19:06 UTC (permalink / raw) To: Nathan Chancellor Cc: Boris Brezillon, Richard Weinberger, linux-kernel, Liang Yang, linux-mtd, Kevin Hilman, linux-amlogic, linux-arm-kernel Hi Nathan, Nathan Chancellor <natechancellor@gmail.com> wrote on Tue, 29 Jan 2019 14:46:57 -0700: > On arm little endian allyesconfig: > > ld.lld: error: undefined symbol: __aeabi_uldivmod > >>> referenced by meson_nand.c > >>> mtd/nand/raw/meson_nand.o:(meson_nfc_setup_data_interface) in archive drivers/built-in.a > > The dividend tBERS_max is u64, meaning we need to use DIV_ROUND_UP_ULL > (which wraps do_div) to prevent the compiler from emitting > __aebi_uldivmod. > > Fixes: 2d570b34b41a ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> > --- Merged in nand/next with the original commit. Thanks, Miquèl _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-02-05 19:07 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-01-29 21:46 [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms Nathan Chancellor 2019-01-30 5:20 ` Liang Yang 2019-01-30 9:26 ` Liang Yang 2019-01-30 9:32 ` Miquel Raynal 2019-01-30 15:27 ` Nathan Chancellor 2019-01-31 2:42 ` Liang Yang 2019-02-05 19:06 ` Miquel Raynal
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).