From: Brian Norris <computersforpeace@gmail.com>
To: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [l2-mtd:master 149/149] ERROR: "__umoddi3" [drivers/mtd/devices/mtdram.ko] undefined!
Date: Tue, 29 Sep 2015 17:29:58 -0700 [thread overview]
Message-ID: <20150930002958.GC143959@google.com> (raw)
In-Reply-To: <560B293B.2060001@cn.fujitsu.com>
+ 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@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@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
>
next parent reply other threads:[~2015-09-30 0:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201509300759.Ipr62suj%fengguang.wu@intel.com>
[not found] ` <560B293B.2060001@cn.fujitsu.com>
2015-09-30 0:29 ` Brian Norris [this message]
2015-09-30 1:01 ` [PATCH v2 0/3] mtdram: check offs and len in mtdram->erase Dongsheng Yang
2015-09-30 1:01 ` [PATCH v2 1/3] mtd: " Dongsheng Yang
2015-10-20 1:09 ` Brian Norris
2015-09-30 1:01 ` [PATCH v2 2/3] mtd: test: refactor mtdtest_erase_eraseblock to introduce a new mtdtest_erase function Dongsheng Yang
2015-09-30 1:01 ` [PATCH v2 3/3] mtd: tests: introduce a erase test Dongsheng Yang
2015-10-20 1:18 ` Brian Norris
2015-10-20 1:20 ` Brian Norris
2015-10-20 1:42 ` Dongsheng Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150930002958.GC143959@google.com \
--to=computersforpeace@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=yangds.fnst@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).