Thread (7 messages) 7 messages, 3 authors, 2019-02-05

Re: [PATCH] mtd: rawnand: meson: Fix linking error on 32-bit platforms

From: Nathan Chancellor <hidden>
Date: 2019-01-30 15:27:13
Also in: linux-amlogic, lkml

On Wed, Jan 30, 2019 at 10:32:20AM +0100, Miquel Raynal wrote:
Hi Liang, Nathan,

Liang Yang [off-list ref] wrote on Wed, 30 Jan 2019 17:26:39
+0800:
quoted
Hi Nathan,

On 2019/1/30 5:46, Nathan Chancellor wrote:
quoted
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 <redacted>
---
  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-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help