From: Jesper Nilsson <jesper.nilsson@axis.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Brian Norris <computersforpeace@gmail.com>,
Richard Weinberger <richard@nod.at>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Jesper Nilsson <jespern@axis.com>,
linux-cris-kernel@axis.com
Subject: Re: Problems with 'mtd: warn when registering the same master many times'
Date: Mon, 2 Nov 2015 21:51:04 +0100 [thread overview]
Message-ID: <20151102205103.GC22903@axis.com> (raw)
In-Reply-To: <20151102200931.GA26577@roeck-us.net>
On Mon, Nov 02, 2015 at 12:09:31PM -0800, Guenter Roeck wrote:
> On Mon, Nov 02, 2015 at 09:43:56AM -0800, Brian Norris wrote:
> > On Mon, Nov 02, 2015 at 07:41:48AM -0800, Guenter Roeck wrote:
> > > I also see the warning in crisv32 runtime tests. This is because the code in
> > > arch/cris/arch-v32/drivers/axisflashmap.c calls mtd_device_register() multiple times
> > > with the same mtd_info argument, each time to register a different partition.
> > > I am not sure if the check is appropriate for this case either, since the code calls
> > > mtd_device_register(), both 'type' and 'parser_data' are NULL, parse_mtd_partitions()
> > > does not do anything, and the problem you are concerned about does not apply.
> >
> > Actually, that platform is probably one of the main reasons for the
> > warning patch. It is not kosher to call mtd_device_register() as many
> > times as it does. So, you get a warning until somebody can be bothered
> > to fix that ugly code.
> >
> > > How about changing the warning to something like the following ?
> > >
> > > WARN_ONCE(types && mtd->_reboot && mtd->reboot_notifier.notifier_call, "MTD already registered\n");
> >
> > No, that doesn't make much sense. We might as well just be removing the
> > check entirely at that point, since this just looks like you're shooting
> > at a random/fragile hack.
> >
> > > This would eliminate (what I think are) false positives and only warn if there
> > > is a real problem.
> >
> > I think we have the option of either taking patch [1] or taking your
> > first suggestion. But the axisflashmap.c is not a false positive, and it
> > should be fixed. Or just live with the warning, if it's unmaintained.
> >
> We'll see if Jesper has any comments. I didn't see an easy way to fix that
> driver myself, so I guess we may have to live with the warning for now.
Yeah, I'm sorry to say that we're aware of the problem but haven't
got to fixing it... At one time (3.20?), the code actually went into
an infinite loop on startup. :-(
I'll boost this to the head of the queue to be fixed, but I hope you can live
with the warning until we can find a mythical "Round Tuit".
> Thanks,
> Guenter
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com
prev parent reply other threads:[~2015-11-02 20:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 15:41 Problems with 'mtd: warn when registering the same master many times' Guenter Roeck
2015-11-02 17:43 ` Brian Norris
2015-11-02 20:09 ` Guenter Roeck
2015-11-02 20:51 ` Jesper Nilsson [this message]
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=20151102205103.GC22903@axis.com \
--to=jesper.nilsson@axis.com \
--cc=computersforpeace@gmail.com \
--cc=jespern@axis.com \
--cc=linux-cris-kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux@roeck-us.net \
--cc=richard@nod.at \
/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).