DSPBRIDGE: Fix module build warnings
PATCH 1/1 DSPBRIDGE: Fix module build warnings
--- drivers/dsp/bridge/rmgr/drv_interface.c | 6 ---- drivers/dsp/bridge/rmgr/node.c | 1 - drivers/dsp/bridge/wmd/tiomap3430.c | 39 ++++++++++++++++--------------- 3 files changed, 20 insertions(+), 26 deletions(-)
drivers/dsp/bridge/rmgr/drv_interface.c +0 -6
@@ -685,12 +685,6 @@ static int bridge_release(struct inode *ip, struct file *filp)return status; } -static void bridge_free (struct device *dev) -{ -/* nothing to Free */ -} - -/* This function provides IO interface to the bridge driver. */ static int bridge_ioctl (struct inode *ip,struct file *filp,unsigned int code,unsigned long args)
drivers/dsp/bridge/rmgr/node.c +0 -1
@@ -3471,7 +3471,6 @@ static DSP_STATUS GetRMSFxns(struct NODE_MGR *hNodeMgr) } } } -func_end:return status; }
drivers/dsp/bridge/wmd/tiomap3430.c +20 -19
@@ -2034,26 +2034,27 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va,if (pfn_valid (__phys_to_pfn (patemp))) { pg =phys_to_page (patemp);get_page (pg); +if (page_count (pg) <=1 ) { +printk (KERN_EMERG "DSPBRIDGE:MAP " +"function: COUNT 0 FOR PA " +"0x%x\n" , patemp); +printk (KERN_EMERG "Bad page state" +"in process '%s'\n" +"page:%p flags:0x%0*lx " +"mapping:%p mapcount:%d " +"count:%d\n" +"Trying to fix it up, but " +"a reboot is needed\n" +"Backtrace:\n" , + current->comm, pg, + (int )(2 *sizeof (unsigned long )), + (unsigned long )pg->flags, + pg->mapping,page_mapcount (pg), +page_count (pg)); +dump_stack (); +BUG_ON (1 ); + } } -if (page_count (pg) <=1 ) { -printk (KERN_EMERG "DSPBRIDGE:MAP function: " -"COUNT 0 FOR PA 0x%x\n" , patemp); -printk (KERN_EMERG "Bad page state" -KERN_EMERG "in process '%s'\n" -KERN_EMERG "page:%p flags:0x%0*lx " -KERN_EMERG "mapping:%p mapcount:%d " -KERN_EMERG "count:%d\n" -KERN_EMERG "Trying to fix it up, but " -KERN_EMERG "a reboot is needed\n" -KERN_EMERG "Backtrace:\n" , - current->comm, pg, - (int )(2 *sizeof (unsigned long )), - (unsigned long )pg->flags, pg->mapping, -page_mapcount (pg),page_count (pg)); -dump_stack (); -BUG_ON (1 ); - } - patemp +=HW_PAGE_SIZE_4KB ; } }
Signature · 1 line
1.6.2.1
Quoted 18 lines · Ameya Palande
drivers/dsp/bridge/wmd/tiomap3430.c +10
-0@@ -2034,26 +2034,27 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va,if (pfn_valid (__phys_to_pfn (patemp))) { pg =phys_to_page (patemp);get_page (pg); +if (page_count (pg) <=1 ) { +printk (KERN_EMERG "DSPBRIDGE:MAP " +"function: COUNT 0 FOR PA " +"0x%x\n" , patemp); +printk (KERN_EMERG "Bad page state" +"in process '%s'\n" +"page:%p flags:0x%0*lx " +"mapping:%p mapcount:%d " +"count:%d\n" + "Trying to fix it up, but "
drivers/dsp/bridge/wmd/tiomap3430.c static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, · line 2056
Quoted 10 lines
drivers/dsp/bridge/wmd/tiomap3430.c +10
-0+"a reboot is needed\n" +"Backtrace:\n" , + current->comm, pg, + (int )(2 *sizeof (unsigned long )), + (unsigned long )pg->flags, + pg->mapping,page_mapcount (pg), + page_count(pg)); +dump_stack (); +BUG_ON (1 ); + }
Is it possible to clean up this print? How much should I drink to read this code?
Why you guys don't create dump finctions which dump whatever you need. E.g., create a "dump_page_state(struct page *pg)" function and call it.
Signature · 6 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 16 lines · Artem Bityutskiy
Quoted 15 lines · Ameya Palande
drivers/dsp/bridge/wmd/tiomap3430.c +6
-0@@ -2034,26 +2034,27 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, if (pfn_valid(__phys_to_pfn(patemp))) { pg =phys_to_page (patemp);get_page (pg); +if (page_count (pg) <=1 ) { +printk (KERN_EMERG "DSPBRIDGE:MAP " +"function: COUNT 0 FOR PA " +"0x%x\n" , patemp); +printk (KERN_EMERG "Bad page state" + "in process '%s'\n"
Quoted 8 lines
drivers/dsp/bridge/wmd/tiomap3430.c static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, · line 2050
Quoted 8 lines
drivers/dsp/bridge/wmd/tiomap3430.c +8
-0+"page:%p flags:0x%0*lx " +"mapping:%p mapcount:%d " +"count:%d\n" +"Trying to fix it up, but " +"a reboot is needed\n" +"Backtrace:\n" , + current->comm, pg, + (int)(2*sizeof(unsigned long)),
Why do you need this (int) cast? Thiere is a %zd modifyer.
Quoted 1 line
drivers/dsp/bridge/wmd/tiomap3430.c static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, · line 2051
Quoted 1 line
drivers/dsp/bridge/wmd/tiomap3430.c +1
-0+ (unsigned long)pg->flags,
What for do you have to cast here?
Signature · 6 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 34 lines · Ameya Palande
Hi Artem,
Quoted 30 lines · Artem Bityutskiy
Quoted 17 lines · Artem Bityutskiy
Quoted 15 lines · Ameya Palande
drivers/dsp/bridge/wmd/tiomap3430.c +6
-0@@ -2034,26 +2034,27 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, if (pfn_valid(__phys_to_pfn(patemp))) { pg = phys_to_page(patemp); get_page(pg); + if (page_count(pg) <= 1) { + printk(KERN_EMERG "DSPBRIDGE:MAP " + "function: COUNT 0 FOR PA " + "0x%x\n", patemp); + printk(KERN_EMERG "Bad page state" + "in process '%s'\n"Quoted 8 lines
drivers/dsp/bridge/wmd/tiomap3430.c static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, · line 2050
Quoted 8 lines
drivers/dsp/bridge/wmd/tiomap3430.c +8
-0+ "page:%p flags:0x%0*lx " + "mapping:%p mapcount:%d " + "count:%d\n" + "Trying to fix it up, but " + "a reboot is needed\n" + "Backtrace:\n", + current->comm, pg, + (int)(2*sizeof(unsigned long)),Why do you need this (int) cast? Thiere is a %zd modifyer.
Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ (unsigned long)pg->flags,
What for do you have to cast here?
I have attached a new patch which should take care of the ugly code.
Cheers,
Ameya.
Sorry about the last message. This one is in plain text.
Cheers,
Ameya.
From 5b889f8c43c0d3af47cd4ed532a10beec863e370 Mon Sep 17 00:00:00 2001
From: Ameya Palande <[email protected]>
Date: Wed, 1 Apr 2009 16:05:13 +0300
Subject: [PATCH] [PATCH] DSPBRIDGE: Fix module build warnings
From: Ameya Palande <[email protected]>
--- drivers/dsp/bridge/rmgr/drv_interface.c | 6 ------ drivers/dsp/bridge/rmgr/node.c | 2 +- drivers/dsp/bridge/wmd/tiomap3430.c | 30 ++++++++++++------------------ 3 files changed, 13 insertions(+), 25 deletions(-)
drivers/dsp/bridge/rmgr/drv_interface.c +0 -6
@@ -685,12 +685,6 @@ static int bridge_release(struct inode *ip, struct file *filp)return status; } -static void bridge_free (struct device *dev) -{ -/* nothing to Free */ -} - -/* This function provides IO interface to the bridge driver. */ static int bridge_ioctl (struct inode *ip,struct file *filp,unsigned int code,unsigned long args)
drivers/dsp/bridge/rmgr/node.c +1 -1
@@ -3471,7 +3471,7 @@ static DSP_STATUS GetRMSFxns(struct NODE_MGR *hNodeMgr) } } } -func_end: +return status; }
drivers/dsp/bridge/wmd/tiomap3430.c +12 -18
@@ -2034,24 +2034,8 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va,if (pfn_valid (__phys_to_pfn (patemp))) { pg =phys_to_page (patemp);get_page (pg); - } -if (page_count (pg) <=1 ) { -printk (KERN_EMERG "DSPBRIDGE:MAP function: " -"COUNT 0 FOR PA 0x%x\n" , patemp); -printk (KERN_EMERG "Bad page state" -KERN_EMERG "in process '%s'\n" -KERN_EMERG "page:%p flags:0x%0*lx " -KERN_EMERG "mapping:%p mapcount:%d " -KERN_EMERG "count:%d\n" -KERN_EMERG "Trying to fix it up, but " -KERN_EMERG "a reboot is needed\n" -KERN_EMERG "Backtrace:\n" , - current->comm, pg, - (int )(2 *sizeof (unsigned long )), - (unsigned long )pg->flags, pg->mapping, -page_mapcount (pg),page_count (pg)); -dump_stack (); -BUG_ON (1 ); +if (page_count (pg) <=1 ) + goto pg_cnt_err_out; } patemp +=HW_PAGE_SIZE_4KB ;
@@ -2126,6 +2110,16 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, }DBG_Trace (DBG_ENTER ,"< PteSet status %x\n" , status);return status; + +pg_cnt_err_out: +pr_emerg ("DSPBRIDGE:MAP function: COUNT 0 FOR PA 0x%x\n" , patemp); +pr_emerg ("Bad page state in process '%s'\n page:%p flags:%lx " +"mapping:%p mapcount:%d count:%d\n" , + current->comm, pg, pg->flags, + pg->mapping,page_mapcount (pg),page_count (pg)); +pr_emerg ("Backtrace:\n" ); +dump_stack (); +BUG_ON (1 ); }/* Memory map kernel VA -- memory allocated with vmalloc */
Signature · 1 line
1.6.2.1
Quoted 41 lines · Ameya Palande
Quoted 40 lines · Ameya Palande
Hi Artem,
Quoted 30 lines · Artem Bityutskiy
Quoted 17 lines · Artem Bityutskiy
Quoted 15 lines · Ameya Palande
drivers/dsp/bridge/wmd/tiomap3430.c +6
-0@@ -2034,26 +2034,27 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, if (pfn_valid(__phys_to_pfn(patemp))) { pg = phys_to_page(patemp); get_page(pg); + if (page_count(pg) <= 1) { + printk(KERN_EMERG "DSPBRIDGE:MAP " + "function: COUNT 0 FOR PA " + "0x%x\n", patemp); + printk(KERN_EMERG "Bad page state" + "in process '%s'\n"Quoted 8 lines
drivers/dsp/bridge/wmd/tiomap3430.c static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, · line 2050
Quoted 8 lines
drivers/dsp/bridge/wmd/tiomap3430.c +8
-0+ "page:%p flags:0x%0*lx " + "mapping:%p mapcount:%d " + "count:%d\n" + "Trying to fix it up, but " + "a reboot is needed\n" + "Backtrace:\n", + current->comm, pg, + (int)(2*sizeof(unsigned long)),Why do you need this (int) cast? Thiere is a %zd modifyer.
Quoted 1 line
Quoted 1 line
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ (unsigned long)pg->flags,
What for do you have to cast here?
I have attached a new patch which should take care of the ugly code.
Quoted 8 lines
Quoted 2 lines
Cheers,
Ameya.Sorry about the last message. This one is in plain text.
Cheers,
Ameya.
This one removes dump_stack() and BUG_ON().
Cheers,
Ameya.
From a427ddb9ad83dbb0f8165f9c1bfcc0a5e2fcd3cd Mon Sep 17 00:00:00 2001
From: Ameya Palande <[email protected]>
Date: Wed, 1 Apr 2009 16:05:13 +0300
Subject: [PATCH] [PATCH] DSPBRIDGE: Fix module build warnings
From: Ameya Palande <[email protected]>
--- drivers/dsp/bridge/rmgr/drv_interface.c | 6 ------ drivers/dsp/bridge/rmgr/node.c | 2 +- drivers/dsp/bridge/wmd/tiomap3430.c | 29 +++++++++++------------------ 3 files changed, 12 insertions(+), 25 deletions(-)
drivers/dsp/bridge/rmgr/drv_interface.c +0 -6
@@ -685,12 +685,6 @@ static int bridge_release(struct inode *ip, struct file *filp)return status; } -static void bridge_free (struct device *dev) -{ -/* nothing to Free */ -} - -/* This function provides IO interface to the bridge driver. */ static int bridge_ioctl (struct inode *ip,struct file *filp,unsigned int code,unsigned long args)
drivers/dsp/bridge/rmgr/node.c +1 -1
@@ -3471,7 +3471,7 @@ static DSP_STATUS GetRMSFxns(struct NODE_MGR *hNodeMgr) } } } -func_end: +return status; }
drivers/dsp/bridge/wmd/tiomap3430.c +11 -18
@@ -2034,24 +2034,8 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va,if (pfn_valid (__phys_to_pfn (patemp))) { pg =phys_to_page (patemp);get_page (pg); - } -if (page_count (pg) <=1 ) { -printk (KERN_EMERG "DSPBRIDGE:MAP function: " -"COUNT 0 FOR PA 0x%x\n" , patemp); -printk (KERN_EMERG "Bad page state" -KERN_EMERG "in process '%s'\n" -KERN_EMERG "page:%p flags:0x%0*lx " -KERN_EMERG "mapping:%p mapcount:%d " -KERN_EMERG "count:%d\n" -KERN_EMERG "Trying to fix it up, but " -KERN_EMERG "a reboot is needed\n" -KERN_EMERG "Backtrace:\n" , - current->comm, pg, - (int )(2 *sizeof (unsigned long )), - (unsigned long )pg->flags, pg->mapping, -page_mapcount (pg),page_count (pg)); -dump_stack (); -BUG_ON (1 ); +if (page_count (pg) <=1 ) + goto pg_cnt_err_out; } patemp +=HW_PAGE_SIZE_4KB ;
@@ -2126,6 +2110,15 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, u32 va, }DBG_Trace (DBG_ENTER ,"< PteSet status %x\n" , status);return status; + +pg_cnt_err_out: +pr_emerg ("DSPBRIDGE:MAP function: COUNT 0 FOR PA 0x%x\n" , patemp); +pr_emerg ("Bad page state in process '%s'\n page:%p flags:%lx " +"mapping:%p mapcount:%d count:%d\n" , + current->comm, pg, pg->flags, + pg->mapping,page_mapcount (pg),page_count (pg)); +pr_emerg ("Backtrace:\n" ); +BUG (); }/* Memory map kernel VA -- memory allocated with vmalloc */
Signature · 1 line
1.6.2.1