linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] trivial: Changed the printk loglevel when not able to allocate memory
@ 2011-05-17 17:29 anish
  2011-05-17 17:43 ` Catalin Marinas
  0 siblings, 1 reply; 6+ messages in thread
From: anish @ 2011-05-17 17:29 UTC (permalink / raw)
  To: linux, lethal; +Cc: linux-fbdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 762 bytes --]

When not able to allocate memory we were using KERN_INFO as 
log level in printk so changed to KERN_ERR
 Signed-off-by: anish kumar<anish198519851985@gmail.com>

---
 drivers/video/amba-clcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index cb7ec86..e87d98b 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -551,7 +551,7 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
 
 	fb = kzalloc(sizeof(*fb), GFP_KERNEL);
 	if (!fb) {
-		printk(KERN_INFO "CLCD: could not allocate new clcd_fb struct\n");
+		printk(KERN_ERR "CLCD: could not allocate new clcd_fb struct\n");
 		ret = -ENOMEM;
 		goto free_region;
 	}
-- 
1.7.0.4



[-- Attachment #2: 0002-Changed-the-printk-loglevel-when-not-able-to-allocat.patch --]
[-- Type: text/x-patch, Size: 984 bytes --]

>From 19bbb666a6067a6ba280e2cb984c924bcaf06f52 Mon Sep 17 00:00:00 2001
From: anish kumar <anish198519851985@gmail.com>
Date: Tue, 17 May 2011 22:50:59 +0530
Subject: [PATCH 2/2] Changed the printk loglevel when not able to allocate memory
 When not able to allocate memory we were using KERN_INFO so just
 changed to KERN_ERR
 Signed-off-by: anish kumar<anish198519851985@gmail.com>

---
 drivers/video/amba-clcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index cb7ec86..e87d98b 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -551,7 +551,7 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
 
 	fb = kzalloc(sizeof(*fb), GFP_KERNEL);
 	if (!fb) {
-		printk(KERN_INFO "CLCD: could not allocate new clcd_fb struct\n");
+		printk(KERN_ERR "CLCD: could not allocate new clcd_fb struct\n");
 		ret = -ENOMEM;
 		goto free_region;
 	}
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] trivial: Changed the printk loglevel when not able to allocate memory
  2011-05-17 17:29 [PATCH 2/2] trivial: Changed the printk loglevel when not able to allocate memory anish
@ 2011-05-17 17:43 ` Catalin Marinas
       [not found]   ` <BANLkTi=ngJiMyVt4AMqcWUSUM2EVXtjRQQ@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Catalin Marinas @ 2011-05-17 17:43 UTC (permalink / raw)
  To: anish; +Cc: linux, lethal, linux-fbdev, linux-kernel

On 17 May 2011 18:29, anish <anish198519851985@gmail.com> wrote:
> When not able to allocate memory we were using KERN_INFO as
> log level in printk so changed to KERN_ERR
>  Signed-off-by: anish kumar<anish198519851985@gmail.com>

Maybe KERN_WARN?

-- 
Catalin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] trivial: Changed the printk loglevel when not able to allocate memory
       [not found]   ` <BANLkTi=ngJiMyVt4AMqcWUSUM2EVXtjRQQ@mail.gmail.com>
@ 2011-05-18 10:15     ` Catalin Marinas
       [not found]       ` <BANLkTinZ6d1=58Y0SCL72Jh3F6R8yfqE-Q@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Catalin Marinas @ 2011-05-18 10:15 UTC (permalink / raw)
  To: anish singh; +Cc: linux, lethal, linux-fbdev, linux-kernel

On Wed, 2011-05-18 at 04:19 +0100, anish singh wrote:
> On Tue, May 17, 2011 at 11:13 PM, Catalin Marinas <catalin.marinas@arm.com> wrote:
>         On 17 May 2011 18:29, anish <anish198519851985@gmail.com> wrote:
>         > When not able to allocate memory we were using KERN_INFO as
>         > log level in printk so changed to KERN_ERR
>         >  Signed-off-by: anish kumar<anish198519851985@gmail.com>
>         
>         
>         Maybe KERN_WARN?
> Then shouldn't we change below case also?
> 467         ret = amba_request_regions(dev, NULL);
> 468         if (ret) {
> 469                 printk(KERN_ERR "CLCD: unable to reserve regs region\n");
> 470                 goto out;
> 
> If yes,then i will resend the patch for this also.

I think the register reserving is less likely to fail because of memory
allocations but more because of overlapping regions, in which case it
could be a programming error.

Allocating a big framebuffer is likely to fail in some memory constraint
systems but I don't consider this a kernel error. That's why I suggested
warning.

-- 
Catalin



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] trivial: Changed the printk loglevel when not able to allocate memory
       [not found]       ` <BANLkTinZ6d1=58Y0SCL72Jh3F6R8yfqE-Q@mail.gmail.com>
@ 2011-05-18 11:01         ` Catalin Marinas
  2011-05-18 11:24         ` Russell King - ARM Linux
  1 sibling, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2011-05-18 11:01 UTC (permalink / raw)
  To: anish singh; +Cc: linux, lethal, linux-fbdev, linux-kernel

On Wed, 2011-05-18 at 11:57 +0100, anish singh wrote:
> On Wed, May 18, 2011 at 3:45 PM, Catalin Marinas <catalin.marinas@arm.com> wrote:
>         
>         On Wed, 2011-05-18 at 04:19 +0100, anish singh wrote:
>         > On Tue, May 17, 2011 at 11:13 PM, Catalin Marinas <catalin.marinas@arm.com> wrote:
>         >         On 17 May 2011 18:29, anish <anish198519851985@gmail.com> wrote:
>         >         > When not able to allocate memory we were using KERN_INFO as
>         >         > log level in printk so changed to KERN_ERR
>         >         >  Signed-off-by: anish kumar<anish198519851985@gmail.com>
>         >
>         >
>         >         Maybe KERN_WARN?
>         > Then shouldn't we change below case also?
>         > 467         ret = amba_request_regions(dev, NULL);
>         > 468         if (ret) {
>         > 469                 printk(KERN_ERR "CLCD: unable to reserve regs region\n");
>         > 470                 goto out;
>         >
>         > If yes,then i will resend the patch for this also.
>         
>         
>         I think the register reserving is less likely to fail because of memory
>         allocations but more because of overlapping regions, in which case it
>         could be a programming error.
>         
>         Allocating a big framebuffer is likely to fail in some memory constraint
>         systems but I don't consider this a kernel error. That's why I suggested
>         warning.
>  
> Got it.So should i change both as KERN_WARN and resend?

No, just the one KERN_INFO one. Anyway, Russell King is the maintainer
of this driver so it's up to him to ack the patch (and don't forget to
cc him).

-- 
Catalin



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] trivial: Changed the printk loglevel when not able to allocate memory
       [not found]       ` <BANLkTinZ6d1=58Y0SCL72Jh3F6R8yfqE-Q@mail.gmail.com>
  2011-05-18 11:01         ` Catalin Marinas
@ 2011-05-18 11:24         ` Russell King - ARM Linux
  2011-05-18 11:26           ` Russell King - ARM Linux
  1 sibling, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-05-18 11:24 UTC (permalink / raw)
  To: anish singh; +Cc: Catalin Marinas, lethal, linux-fbdev, linux-kernel

On Wed, May 18, 2011 at 04:27:47PM +0530, anish singh wrote:
> Got it.So should i change both as KERN_WARN and resend?

Much better would be to change it to pr_warn() or even
dev_warn(&dev->dev, ...).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] trivial: Changed the printk loglevel when not able to allocate memory
  2011-05-18 11:24         ` Russell King - ARM Linux
@ 2011-05-18 11:26           ` Russell King - ARM Linux
  0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-05-18 11:26 UTC (permalink / raw)
  To: anish singh; +Cc: Catalin Marinas, lethal, linux-fbdev, linux-kernel

On Wed, May 18, 2011 at 12:24:36PM +0100, Russell King - ARM Linux wrote:
> On Wed, May 18, 2011 at 04:27:47PM +0530, anish singh wrote:
> > Got it.So should i change both as KERN_WARN and resend?
> 
> Much better would be to change it to pr_warn() or even
> dev_warn(&dev->dev, ...).

Actually, make that pr_err() or dev_err().  Both printks in clcdfb_probe()
are errors and so should be reported at error severity - they cause things
to stop working and so they're not just a warning.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-18 11:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-17 17:29 [PATCH 2/2] trivial: Changed the printk loglevel when not able to allocate memory anish
2011-05-17 17:43 ` Catalin Marinas
     [not found]   ` <BANLkTi=ngJiMyVt4AMqcWUSUM2EVXtjRQQ@mail.gmail.com>
2011-05-18 10:15     ` Catalin Marinas
     [not found]       ` <BANLkTinZ6d1=58Y0SCL72Jh3F6R8yfqE-Q@mail.gmail.com>
2011-05-18 11:01         ` Catalin Marinas
2011-05-18 11:24         ` Russell King - ARM Linux
2011-05-18 11:26           ` Russell King - ARM Linux

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).