All of lore.kernel.org
 help / color / mirror / Atom feed
From: Murali Nalajala <mnalajal@codeaurora.org>
To: dedekind1@gmail.com
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org,
	linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Dima Zavin" <dima@android.com>,
	"Brian Swetland" <swetland@google.com>,
	"Arve Hjønnevåg" <arve@android.com>
Subject: Re: [PATCH 2/2] mtd: msm_nand: Add initial msm nand driver support.
Date: Fri, 15 Apr 2011 20:20:12 +0530	[thread overview]
Message-ID: <4DA85B24.50807@codeaurora.org> (raw)
In-Reply-To: <1302861097.3220.12.camel@localhost>

On 4/15/2011 3:21 PM, Artem Bityutskiy wrote:
> On Tue, 2011-03-01 at 06:17 +0530, Murali Nalajala wrote:
>> +#define pr_fmt(fmt) "%s:" fmt, __func__
>> +
>> +#include<linux/kernel.h>
>> +#include<linux/mtd/mtd.h>
>> +#include<linux/mtd/nand.h>
>> +#include<linux/mtd/partitions.h>
>> +#include<linux/platform_device.h>
>> +#include<linux/sched.h>
>> +#include<linux/slab.h>
>> +#include<linux/dma-mapping.h>
>> +#include<asm/mach/flash.h>
>> +#include<mach/dma.h>
>> +
>> +#include "msm_nand.h"
>> +
>> +unsigned long msm_nand_phys;
>
> No global variables like this please. Here is how you use them:
>
> +extern unsigned long msm_nand_phys;

extern declaration in the 'C' file causing warning. We are in plan to 
upload the OneNAND changes soon which makes use of the same .h file.

> +#define MSM_NAND_REG(off) (msm_nand_phys + (off))
> +
> +#define MSM_NAND_FLASH_CMD            MSM_NAND_REG(0x0000)
> +#define MSM_NAND_ADDR0                MSM_NAND_REG(0x0004)
>
> Could you please make the macros to take the "struct msm_nand_chip
> *chip" argument instead, and store the pase address there. Do not hide
> the fact that those macros are actually functions, not constant - this
> is error prone.
>
> Besides, I'm do not know your HW, but if you have several controllers
> with various base addresses - your driver won't work.

you are correct, we have multiple controllers, which breaks this logic 
in future.

>
>> +	pr_info("Save cfg0 = %x cfg1 = %x\n", chip->cfg0, chip->cfg1);
>> +	pr_info("cfg0: cw/page=%d ud_sz=%d ecc_sz=%d spare_sz=%d "
>> +		"num_addr_cycles=%d\n", (chip->cfg0>>  6)&  7,
>> +		(chip->cfg0>>  9)&  0x3ff, (chip->cfg0>>  19)&  15,
>> +		(chip->cfg0>>  23)&  15, (chip->cfg0>>  27)&  7);
>
> Please, revise all your pr_info() calls and turn most of them into
> dev_dbg() or pr_debug. Your driver should be completely silent by
> default, except of error messages and some information messages when it
> is initialized.
>
>
I will revise all the pr_info calls and change the inappropriate calls 
to pr_debug.

Thanks,
Murali N

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

WARNING: multiple messages have this Message-ID (diff)
From: Murali Nalajala <mnalajal@codeaurora.org>
To: dedekind1@gmail.com
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Dima Zavin" <dima@android.com>,
	"Arve Hjønnevåg" <arve@android.com>,
	linux-mtd@lists.infradead.org,
	"Brian Swetland" <swetland@google.com>,
	dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] mtd: msm_nand: Add initial msm nand driver support.
Date: Fri, 15 Apr 2011 20:20:12 +0530	[thread overview]
Message-ID: <4DA85B24.50807@codeaurora.org> (raw)
In-Reply-To: <1302861097.3220.12.camel@localhost>

On 4/15/2011 3:21 PM, Artem Bityutskiy wrote:
> On Tue, 2011-03-01 at 06:17 +0530, Murali Nalajala wrote:
>> +#define pr_fmt(fmt) "%s:" fmt, __func__
>> +
>> +#include<linux/kernel.h>
>> +#include<linux/mtd/mtd.h>
>> +#include<linux/mtd/nand.h>
>> +#include<linux/mtd/partitions.h>
>> +#include<linux/platform_device.h>
>> +#include<linux/sched.h>
>> +#include<linux/slab.h>
>> +#include<linux/dma-mapping.h>
>> +#include<asm/mach/flash.h>
>> +#include<mach/dma.h>
>> +
>> +#include "msm_nand.h"
>> +
>> +unsigned long msm_nand_phys;
>
> No global variables like this please. Here is how you use them:
>
> +extern unsigned long msm_nand_phys;

extern declaration in the 'C' file causing warning. We are in plan to 
upload the OneNAND changes soon which makes use of the same .h file.

> +#define MSM_NAND_REG(off) (msm_nand_phys + (off))
> +
> +#define MSM_NAND_FLASH_CMD            MSM_NAND_REG(0x0000)
> +#define MSM_NAND_ADDR0                MSM_NAND_REG(0x0004)
>
> Could you please make the macros to take the "struct msm_nand_chip
> *chip" argument instead, and store the pase address there. Do not hide
> the fact that those macros are actually functions, not constant - this
> is error prone.
>
> Besides, I'm do not know your HW, but if you have several controllers
> with various base addresses - your driver won't work.

you are correct, we have multiple controllers, which breaks this logic 
in future.

>
>> +	pr_info("Save cfg0 = %x cfg1 = %x\n", chip->cfg0, chip->cfg1);
>> +	pr_info("cfg0: cw/page=%d ud_sz=%d ecc_sz=%d spare_sz=%d "
>> +		"num_addr_cycles=%d\n", (chip->cfg0>>  6)&  7,
>> +		(chip->cfg0>>  9)&  0x3ff, (chip->cfg0>>  19)&  15,
>> +		(chip->cfg0>>  23)&  15, (chip->cfg0>>  27)&  7);
>
> Please, revise all your pr_info() calls and turn most of them into
> dev_dbg() or pr_debug. Your driver should be completely silent by
> default, except of error messages and some information messages when it
> is initialized.
>
>
I will revise all the pr_info calls and change the inappropriate calls 
to pr_debug.

Thanks,
Murali N

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

WARNING: multiple messages have this Message-ID (diff)
From: mnalajal@codeaurora.org (Murali Nalajala)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] mtd: msm_nand: Add initial msm nand driver support.
Date: Fri, 15 Apr 2011 20:20:12 +0530	[thread overview]
Message-ID: <4DA85B24.50807@codeaurora.org> (raw)
In-Reply-To: <1302861097.3220.12.camel@localhost>

On 4/15/2011 3:21 PM, Artem Bityutskiy wrote:
> On Tue, 2011-03-01 at 06:17 +0530, Murali Nalajala wrote:
>> +#define pr_fmt(fmt) "%s:" fmt, __func__
>> +
>> +#include<linux/kernel.h>
>> +#include<linux/mtd/mtd.h>
>> +#include<linux/mtd/nand.h>
>> +#include<linux/mtd/partitions.h>
>> +#include<linux/platform_device.h>
>> +#include<linux/sched.h>
>> +#include<linux/slab.h>
>> +#include<linux/dma-mapping.h>
>> +#include<asm/mach/flash.h>
>> +#include<mach/dma.h>
>> +
>> +#include "msm_nand.h"
>> +
>> +unsigned long msm_nand_phys;
>
> No global variables like this please. Here is how you use them:
>
> +extern unsigned long msm_nand_phys;

extern declaration in the 'C' file causing warning. We are in plan to 
upload the OneNAND changes soon which makes use of the same .h file.

> +#define MSM_NAND_REG(off) (msm_nand_phys + (off))
> +
> +#define MSM_NAND_FLASH_CMD            MSM_NAND_REG(0x0000)
> +#define MSM_NAND_ADDR0                MSM_NAND_REG(0x0004)
>
> Could you please make the macros to take the "struct msm_nand_chip
> *chip" argument instead, and store the pase address there. Do not hide
> the fact that those macros are actually functions, not constant - this
> is error prone.
>
> Besides, I'm do not know your HW, but if you have several controllers
> with various base addresses - your driver won't work.

you are correct, we have multiple controllers, which breaks this logic 
in future.

>
>> +	pr_info("Save cfg0 = %x cfg1 = %x\n", chip->cfg0, chip->cfg1);
>> +	pr_info("cfg0: cw/page=%d ud_sz=%d ecc_sz=%d spare_sz=%d "
>> +		"num_addr_cycles=%d\n", (chip->cfg0>>  6)&  7,
>> +		(chip->cfg0>>  9)&  0x3ff, (chip->cfg0>>  19)&  15,
>> +		(chip->cfg0>>  23)&  15, (chip->cfg0>>  27)&  7);
>
> Please, revise all your pr_info() calls and turn most of them into
> dev_dbg() or pr_debug. Your driver should be completely silent by
> default, except of error messages and some information messages when it
> is initialized.
>
>
I will revise all the pr_info calls and change the inappropriate calls 
to pr_debug.

Thanks,
Murali N

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2011-04-15 14:50 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01  0:47 [PATCH 1/2] mtd: nand: Allow NAND chip ids to be included standalone Murali Nalajala
2011-03-01  0:47 ` Murali Nalajala
2011-03-01  0:47 ` Murali Nalajala
2011-03-01  0:47 ` [PATCH 2/2] mtd: msm_nand: Add initial msm nand driver support Murali Nalajala
2011-07-08 18:23   ` Murali Nalajala
2011-03-01  0:47   ` Murali Nalajala
2011-03-01  0:47   ` Murali Nalajala
2011-04-15  9:51   ` Artem Bityutskiy
2011-07-08 16:03     ` Artem Bityutskiy
2011-04-15  9:51     ` Artem Bityutskiy
2011-04-15 14:50     ` Murali Nalajala [this message]
2011-04-15 14:50       ` Murali Nalajala
2011-04-15 14:50       ` Murali Nalajala
2011-04-16  8:20       ` Artem Bityutskiy
2011-04-16  8:20         ` Artem Bityutskiy
2011-04-16  8:20         ` Artem Bityutskiy
2011-04-16  8:31         ` Artem Bityutskiy
2011-04-16  8:31           ` Artem Bityutskiy
2011-04-16  8:31           ` Artem Bityutskiy
2011-04-16 10:15           ` Murali Nalajala
2011-04-16 10:15             ` Murali Nalajala
2011-04-16 10:15             ` Murali Nalajala
2011-04-16  9:59         ` Murali Nalajala
2011-04-16  9:59           ` Murali Nalajala
2011-04-16  9:59           ` Murali Nalajala
2011-04-16 14:19           ` Artem Bityutskiy
2011-04-16 14:19             ` Artem Bityutskiy
2011-04-16 14:19             ` Artem Bityutskiy
2011-03-07  8:53 ` [PATCH 1/2] mtd: nand: Allow NAND chip ids to be included standalone Artem Bityutskiy
2011-03-07  8:53   ` Artem Bityutskiy
2011-03-07  8:53   ` Artem Bityutskiy
2011-03-07  8:53   ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DA85B24.50807@codeaurora.org \
    --to=mnalajal@codeaurora.org \
    --cc=arve@android.com \
    --cc=dedekind1@gmail.com \
    --cc=dima@android.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=swetland@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.