From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.nokia.com ([192.100.105.134] helo=mgw-mx09.nokia.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1N8BTb-0003Uq-0R for linux-mtd@lists.infradead.org; Wed, 11 Nov 2009 11:35:07 +0000 Subject: Re: [PATCH v13 4/4]: mtdoops: refactor as a kmsg_dumper From: Artem Bityutskiy To: Simon Kagstrom In-Reply-To: <20091111122721.72a9dcea@marrow.netinsight.se> References: <20091015094057.7298e0d7@marrow.netinsight.se> <20091029133535.2ea65f72@marrow.netinsight.se> <20091029134123.348b5126@marrow.netinsight.se> <1257233392.21596.48.camel@localhost> <20091103141903.23d0d0be@marrow.netinsight.se> <1257869493.21596.809.camel@localhost> <20091111104615.2ea67205@marrow.netinsight.se> <1257935382.21596.1007.camel@localhost> <20091111122721.72a9dcea@marrow.netinsight.se> Content-Type: text/plain; charset="UTF-8" Date: Wed, 11 Nov 2009 13:34:50 +0200 Message-Id: <1257939290.21596.1016.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: linux-mtd Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2009-11-11 at 12:27 +0100, Simon Kagstrom wrote: > On Wed, 11 Nov 2009 12:29:42 +0200 > Artem Bityutskiy wrote: > > > On Wed, 2009-11-11 at 10:46 +0100, Simon Kagstrom wrote: > > > On Tue, 10 Nov 2009 18:11:33 +0200 > > > > > > > Do we really need this notifiers? Would not it be better to open mtd > > > > device straight in the module_init function instead? > > > > > > If the mtdoops driver is built into the kernel, module_init might be > > > (and I believe will be) called before the MTD partitions have been > > > created. With the MTD notifiers, this problem is worked around. > > > > But this is why we have late_initcall(), which we can use instead of > > module_init(). > > OK, makes sense (you learn something new every day!). But I still have > one, perhaps artificial, use-case for keeping it as-is: MTD devices > might show up later if they are loaded as modules. In my case I use > phram as a module, and if I were to use that with MTDoops in the > kernel, I still need the notifiers. I do not insist at all, but I thought this is just error prone way. You load mtdoops, which then lurks, and when appropriate MTD device appears, it grabs it. But what if I just forgot to unload mtdoops and it grabs my mtd1 device and formats it? Besides, currently mtdoops may fail to grab the mtd device for some reasons (an error), and all you have is an error message. If you do not notice it, you may happily think you have working mtdoops, while you do not. -- Best Regards, Artem Bityutskiy (Артём Битюцкий)