[l2-mtd:master 149/149] ERROR: "__umoddi3" [drivers/mtd/devices/mtdram.ko] undefined!

Brian Norris computersforpeace at gmail.com
Tue Sep 29 17:29:58 PDT 2015


+ linux-mtd

On Wed, Sep 30, 2015 at 08:13:47AM +0800, Dongsheng Yang wrote:
> On 09/30/2015 07:36 AM, kbuild test robot wrote:
> >tree:   git://git.infradead.org/users/dedekind/l2-mtd.git master
> >head:   7827e3acad2df1c6537e5fe7211d216dabc60399
> >commit: 7827e3acad2df1c6537e5fe7211d216dabc60399 [149/149] mtd: mtdram: check offs and len in mtdram->erase
> >config: i386-randconfig-i0-201539 (attached as .config)
> >reproduce:
> >   git checkout 7827e3acad2df1c6537e5fe7211d216dabc60399
> >   # save the attached .config to linux build tree
> >   make ARCH=i386
> >
> >All error/warnings (new ones prefixed by >>):
> >
> >>>ERROR: "__umoddi3" [drivers/mtd/devices/mtdram.ko] undefined!
> >>>ERROR: "__moddi3" [drivers/mtd/devices/mtdram.ko] undefined!
> 
> Hi Brian,
> 	It seems i386 does not support mod operation. Please help
> to squash the patch attached. Thanx a lot.

It's not just i386.

> >
> >---
> >0-DAY kernel test infrastructure                Open Source Technology Center
> >https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> >
> 

> From 4034d05f22e46430ac90fa67a2eff059f7fdc7a3 Mon Sep 17 00:00:00 2001
> From: Dongsheng Yang <yangds.fnst at cn.fujitsu.com>
> Date: Wed, 30 Sep 2015 05:02:39 -0400
> Subject: [PATCH] mtdram: use mtd->erasesize_mask rather than mod function.
> 
> kbuild test robot complain that on i386:
> ERROR: "__umoddi3" [drivers/mtd/devices/mtdram.ko] undefined!
> 
> So, fix it by replace '% mtd->erasesize' with '& mtd->erasesize_mask';
> 
> Signed-off-by: Dongsheng Yang <yangds.fnst at cn.fujitsu.com>
> ---
>  drivers/mtd/devices/mtdram.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c
> index 73fa297..8124fc4 100644
> --- a/drivers/mtd/devices/mtdram.c
> +++ b/drivers/mtd/devices/mtdram.c
> @@ -37,13 +37,13 @@ static int check_offs_len(struct mtd_info *mtd, loff_t ofs, uint64_t len)
>  	int ret = 0;
>  
>  	/* Start address must align on block boundary */
> -	if (ofs % mtd->erasesize) {
> +	if (ofs & mtd->erasesize_mask) {

Hmm, but that only works if it's a power-of-two erasesize. Right now,
mtdram technically allows odd sizes. You'll have to add more
checks/restrictions to this driver before I can take this patch.

I've just reverted the patch for now. You can send a better one that
addresses all problems.

Brian

>  		pr_debug("%s: unaligned address\n", __func__);
>  		ret = -EINVAL;
>  	}
>  
>  	/* Length must align on block boundary */
> -	if (len % mtd->erasesize) {
> +	if (len & mtd->erasesize_mask) {
>  		pr_debug("%s: length not block aligned\n", __func__);
>  		ret = -EINVAL;
>  	}
> -- 
> 1.8.4.2
> 




More information about the linux-mtd mailing list