* [PATCH] DSPBRIDGE: Fix module build warnings @ 2009-03-31 16:26 Ameya Palande 2009-04-01 7:00 ` Artem Bityutskiy 0 siblings, 1 reply; 5+ messages in thread From: Ameya Palande @ 2009-03-31 16:26 UTC (permalink / raw) To: h-kanigeri2; +Cc: linux-omap Signed-off-by: Ameya Palande <ameya.palande@nokia.com> --- 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(-) diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c index 350e1b5..981354a 100755 --- a/drivers/dsp/bridge/rmgr/drv_interface.c +++ b/drivers/dsp/bridge/rmgr/drv_interface.c @@ -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) diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c index 51b4b12..66a6284 100644 --- a/drivers/dsp/bridge/rmgr/node.c +++ b/drivers/dsp/bridge/rmgr/node.c @@ -3471,7 +3471,6 @@ static DSP_STATUS GetRMSFxns(struct NODE_MGR *hNodeMgr) } } } -func_end: return status; } diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c index 1fca3e5..b489da1 100644 --- a/drivers/dsp/bridge/wmd/tiomap3430.c +++ b/drivers/dsp/bridge/wmd/tiomap3430.c @@ -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; } } -- 1.6.2.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] DSPBRIDGE: Fix module build warnings 2009-03-31 16:26 [PATCH] DSPBRIDGE: Fix module build warnings Ameya Palande @ 2009-04-01 7:00 ` Artem Bityutskiy 2009-04-01 7:04 ` Artem Bityutskiy 0 siblings, 1 reply; 5+ messages in thread From: Artem Bityutskiy @ 2009-04-01 7:00 UTC (permalink / raw) To: Ameya Palande; +Cc: h-kanigeri2, linux-omap Ameya Palande wrote: > diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c > index 1fca3e5..b489da1 100644 > --- a/drivers/dsp/bridge/wmd/tiomap3430.c > +++ b/drivers/dsp/bridge/wmd/tiomap3430.c > @@ -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); > + } 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. -- Best Regards, Artem Bityutskiy (Артём Битюцкий) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] DSPBRIDGE: Fix module build warnings 2009-04-01 7:00 ` Artem Bityutskiy @ 2009-04-01 7:04 ` Artem Bityutskiy [not found] ` <269694c00904010613g70a5de8eo5cac92865675ad0f@mail.gmail.com> 0 siblings, 1 reply; 5+ messages in thread From: Artem Bityutskiy @ 2009-04-01 7:04 UTC (permalink / raw) To: Ameya Palande; +Cc: h-kanigeri2, linux-omap Artem Bityutskiy wrote: > Ameya Palande wrote: >> diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c >> b/drivers/dsp/bridge/wmd/tiomap3430.c >> index 1fca3e5..b489da1 100644 >> --- a/drivers/dsp/bridge/wmd/tiomap3430.c >> +++ b/drivers/dsp/bridge/wmd/tiomap3430.c >> @@ -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)), Why do you need this (int) cast? Thiere is a %zd modifyer. >> + (unsigned long)pg->flags, What for do you have to cast here? -- Best Regards, Artem Bityutskiy (Артём Битюцкий) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <269694c00904010613g70a5de8eo5cac92865675ad0f@mail.gmail.com>]
* Re: [PATCH] DSPBRIDGE: Fix module build warnings [not found] ` <269694c00904010613g70a5de8eo5cac92865675ad0f@mail.gmail.com> @ 2009-04-01 13:14 ` Ameya Palande 2009-04-01 13:34 ` Ameya Palande 0 siblings, 1 reply; 5+ messages in thread From: Ameya Palande @ 2009-04-01 13:14 UTC (permalink / raw) To: linux-omap@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 1969 bytes --] On Wed, Apr 1, 2009 at 4:13 PM, Ameya Palande <2ameya@gmail.com> wrote: > > Hi Artem, > > On Wed, Apr 1, 2009 at 10:04 AM, Artem Bityutskiy <dedekind@yandex.ru> wrote: >> >> Artem Bityutskiy wrote: >>> >>> Ameya Palande wrote: >>>> >>>> diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c >>>> index 1fca3e5..b489da1 100644 >>>> --- a/drivers/dsp/bridge/wmd/tiomap3430.c >>>> +++ b/drivers/dsp/bridge/wmd/tiomap3430.c >>>> @@ -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)), >> >> Why do you need this (int) cast? Thiere is a %zd modifyer. >>>> >>>> + (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. [-- Attachment #2: 0001--DSPBRIDGE-Fix-module-build-warnings.patch --] [-- Type: text/x-patch, Size: 3129 bytes --] From 5b889f8c43c0d3af47cd4ed532a10beec863e370 Mon Sep 17 00:00:00 2001 From: Ameya Palande <ameya.palande@nokia.com> Date: Wed, 1 Apr 2009 16:05:13 +0300 Subject: [PATCH] [PATCH] DSPBRIDGE: Fix module build warnings From: Ameya Palande <ameya.palande@nokia.com> Signed-off-by: Ameya Palande <ameya.palande@nokia.com> --- 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(-) diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c index 350e1b5..981354a 100755 --- a/drivers/dsp/bridge/rmgr/drv_interface.c +++ b/drivers/dsp/bridge/rmgr/drv_interface.c @@ -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) diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c index 51b4b12..178b802 100644 --- a/drivers/dsp/bridge/rmgr/node.c +++ b/drivers/dsp/bridge/rmgr/node.c @@ -3471,7 +3471,7 @@ static DSP_STATUS GetRMSFxns(struct NODE_MGR *hNodeMgr) } } } -func_end: + return status; } diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c index 1fca3e5..9a535d0 100644 --- a/drivers/dsp/bridge/wmd/tiomap3430.c +++ b/drivers/dsp/bridge/wmd/tiomap3430.c @@ -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 */ -- 1.6.2.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] DSPBRIDGE: Fix module build warnings 2009-04-01 13:14 ` Ameya Palande @ 2009-04-01 13:34 ` Ameya Palande 0 siblings, 0 replies; 5+ messages in thread From: Ameya Palande @ 2009-04-01 13:34 UTC (permalink / raw) To: linux-omap@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 2211 bytes --] On Wed, Apr 1, 2009 at 4:14 PM, Ameya Palande <2ameya@gmail.com> wrote: > On Wed, Apr 1, 2009 at 4:13 PM, Ameya Palande <2ameya@gmail.com> wrote: >> >> Hi Artem, >> >> On Wed, Apr 1, 2009 at 10:04 AM, Artem Bityutskiy <dedekind@yandex.ru> wrote: >>> >>> Artem Bityutskiy wrote: >>>> >>>> Ameya Palande wrote: >>>>> >>>>> diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c >>>>> index 1fca3e5..b489da1 100644 >>>>> --- a/drivers/dsp/bridge/wmd/tiomap3430.c >>>>> +++ b/drivers/dsp/bridge/wmd/tiomap3430.c >>>>> @@ -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)), >>> >>> Why do you need this (int) cast? Thiere is a %zd modifyer. >>>>> >>>>> + (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. > This one removes dump_stack() and BUG_ON(). Cheers, Ameya. [-- Attachment #2: 0001--DSPBRIDGE-Fix-module-build-warnings.patch --] [-- Type: text/x-patch, Size: 3108 bytes --] From a427ddb9ad83dbb0f8165f9c1bfcc0a5e2fcd3cd Mon Sep 17 00:00:00 2001 From: Ameya Palande <ameya.palande@nokia.com> Date: Wed, 1 Apr 2009 16:05:13 +0300 Subject: [PATCH] [PATCH] DSPBRIDGE: Fix module build warnings From: Ameya Palande <ameya.palande@nokia.com> Signed-off-by: Ameya Palande <ameya.palande@nokia.com> --- 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(-) diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c index 350e1b5..981354a 100755 --- a/drivers/dsp/bridge/rmgr/drv_interface.c +++ b/drivers/dsp/bridge/rmgr/drv_interface.c @@ -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) diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c index 51b4b12..178b802 100644 --- a/drivers/dsp/bridge/rmgr/node.c +++ b/drivers/dsp/bridge/rmgr/node.c @@ -3471,7 +3471,7 @@ static DSP_STATUS GetRMSFxns(struct NODE_MGR *hNodeMgr) } } } -func_end: + return status; } diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c index 1fca3e5..d94ce66 100644 --- a/drivers/dsp/bridge/wmd/tiomap3430.c +++ b/drivers/dsp/bridge/wmd/tiomap3430.c @@ -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 */ -- 1.6.2.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-04-01 13:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-31 16:26 [PATCH] DSPBRIDGE: Fix module build warnings Ameya Palande
2009-04-01 7:00 ` Artem Bityutskiy
2009-04-01 7:04 ` Artem Bityutskiy
[not found] ` <269694c00904010613g70a5de8eo5cac92865675ad0f@mail.gmail.com>
2009-04-01 13:14 ` Ameya Palande
2009-04-01 13:34 ` Ameya Palande
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox