From patchwork Wed Apr 1 13:34:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ameya Palande <2ameya@gmail.com> X-Patchwork-Id: 15649 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n31DYiZN008957 for ; Wed, 1 Apr 2009 13:34:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759530AbZDANen (ORCPT ); Wed, 1 Apr 2009 09:34:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760384AbZDANen (ORCPT ); Wed, 1 Apr 2009 09:34:43 -0400 Received: from mail-fx0-f158.google.com ([209.85.220.158]:55490 "EHLO mail-fx0-f158.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759530AbZDANem (ORCPT ); Wed, 1 Apr 2009 09:34:42 -0400 Received: by fxm2 with SMTP id 2so33316fxm.37 for ; Wed, 01 Apr 2009 06:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=qvrrYiP5h4dOHKJgnjsOMBBI1xcZKEf9KIjIBLInvZ8=; b=ao7k6BWg6WzThop5BxkYDKKCB2gRJaLfwKg1lNRrentcLKt0c9Yjx8mdEzzLZ0sf04 jYtnezc94kPW6HOQkU8Ir7WWeRjuqOx691WYKeTT6Nhanfv8GaJPuP1VuDmBys3K076r Gm8Tnj5zIJGVV8MDnH8dVXe2mm6mfCmR/lDUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ZZ0RIfIeSl/ydXTvsAL4rkEm0LLeXxZLnlv8eXt11L1Tk4HZaqGaqvDqPBc890qx3k 0PRowKL4mPZu+kn2mmJvBTTFug5uvwoPr9jl7kbS938Dk0MLQCJDvRcZByR2mvwSwA0V Hvp3K4zv7lOXkGsBlaKS6/YNvIksDb8Bcm2CU= MIME-Version: 1.0 Received: by 10.204.97.140 with SMTP id l12mr2795901bkn.133.1238592879451; Wed, 01 Apr 2009 06:34:39 -0700 (PDT) In-Reply-To: <269694c00904010614k4a2897e6p8c5c5fad120738d9@mail.gmail.com> References: <1238516811-11401-1-git-send-email-ameya.palande@nokia.com> <49D3111E.2060304@yandex.ru> <49D31218.8050200@yandex.ru> <269694c00904010613g70a5de8eo5cac92865675ad0f@mail.gmail.com> <269694c00904010614k4a2897e6p8c5c5fad120738d9@mail.gmail.com> Date: Wed, 1 Apr 2009 16:34:39 +0300 Message-ID: <269694c00904010634q1ad8d8dbg8d75a6be243c1b09@mail.gmail.com> Subject: Re: [PATCH] DSPBRIDGE: Fix module build warnings From: Ameya Palande <2ameya@gmail.com> To: "linux-omap@vger.kernel.org" Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 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. From a427ddb9ad83dbb0f8165f9c1bfcc0a5e2fcd3cd Mon Sep 17 00:00:00 2001 From: Ameya Palande Date: Wed, 1 Apr 2009 16:05:13 +0300 Subject: [PATCH] [PATCH] DSPBRIDGE: Fix module build warnings From: Ameya Palande Signed-off-by: Ameya Palande --- 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