From mboxrd@z Thu Jan 1 00:00:00 1970 From: u.kleine-koenig@pengutronix.de (Uwe =?iso-8859-1?Q?Kleine-K=F6nig?=) Date: Tue, 23 Nov 2010 11:39:40 +0100 Subject: About multi-line printk and the need (not) to repeat loglevel markers [Was: Re: [PATCH] ARM: mx3/pcm037: properly allocate memory for mx3-camera] In-Reply-To: <20101123101210.GA18170@n2100.arm.linux.org.uk> References: <20101011152516.GF27153@n2100.arm.linux.org.uk> <1290505382-16110-1-git-send-email-u.kleine-koenig@pengutronix.de> <20101123101210.GA18170@n2100.arm.linux.org.uk> Message-ID: <20101123103940.GN4693@pengutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hello, [extended the audience to lkml and a few more] On Tue, Nov 23, 2010 at 10:12:11AM +0000, Russell King - ARM Linux wrote: > On Tue, Nov 23, 2010 at 10:43:02AM +0100, Uwe Kleine-K?nig wrote: > > There is no need to memzero the buffer because dma_alloc_coherent zeros > > the memory for us. > > > > This fixes: > > > > BUG: Your driver calls ioremap() on system memory. This leads > > <4>to architecturally unpredictable behaviour on ARMv6+, and ioremap() > > <4>will fail in the next kernel release. Please fix your driver. > > > > Tested-by: Michael Grzeschik > > Signed-off-by: Uwe Kleine-K?nig > > --- > [...] > > I assume sending a patch to remove the <4> is just a waste of time, > > isn't it? (this message is generated by: printk(KERN_WARNING "BUG: Your driver calls ioremap() on system memory. This leads\n" KERN_WARNING "to architecturally unpredictable behaviour on ARMv6+, and ioremap()\n" KERN_WARNING "will fail in the next kernel release. Please fix your driver.\n"); in arch/arm/mm/ioremap.c.) > Hmm, someone changed the behaviour of printk - it used to require the > tag after each newline. It seems that it only requires it as the first > few characters now, which is a pain in the backside if you split > printk's. > > IOW: > > printk(KERN_ERR "foo bar baz "); > printk("buz\n" KERN_WARNING "fiz\n"); > > used to result in "foo bar baz buz" being printed at error level, and > "fiz" at warning level. Today, you'll get "foo bar baz buz" at error > level, and "<4>fiz" at the default level. > > Note that it's not as simple as deleting the KERN_WARNING, because: > printk(KERN_ERR "foo bar baz "); > printk("buz\nfiz\n"); > > will result in the same as above except for the missing <4> - which means > "fiz" still ends up at the wrong severity level. > > Confusingly: > > printk(KERN_ERR "foo bar baz"); > printk(KERN_WARNING "buz\nfiz\n"); > > will do as per the original, but is silly. Wonder how many other places > are broken by this change. I wonder if this was intended. It was introduced in v2.6.31-rc1~324 (printk: clean up handling of log-levels and newlines) by Linus. Thinking about it I consider the current behaviour more sane, because I cannot imagine a valid usecase to change the loglevel in a single printk and having to repeat the same loglevel marker for each newline isn't very effective, too. This for example fixes the usage of pr_warning et al for multiline strings. Is it worth to add some logic to vprint that handles repeating (or even changing) markers after a newline? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |