All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <ext-adrian.hunter@nokia.com>
To: Rohit <h.rohit@samsung.com>
Cc: 'Kyungmin Park' <kmpark@infradead.org>,
	apgmoorthy <moorthy.apg@samsung.com>,
	'David Woodhouse' <dwmw2@infradead.org>,
	linux-mtd@lists.infradead.org, amitsharma.9@samsung.com
Subject: Re: [ANNOUNCE] [PATCH] [MTD] Flex-OneNAND MTD Driver available.
Date: Mon, 10 Nov 2008 17:20:23 +0200	[thread overview]
Message-ID: <49185137.4040300@nokia.com> (raw)
In-Reply-To: <49145004.9010202@samsung.com>

Rohit wrote:
> Adrian Hunter wrote:
>>> +		this->command(mtd, FLEXONENAND_CMD_PI_ACCESS, die, 0);
>>> +		this->wait(mtd, FL_SYNCING);
>> Why is the error return not checked?
>>
>>> +
>>> +		this->command(mtd, ONENAND_CMD_READ, die, 0);
>>> +		ret = this->wait(mtd, FL_READING);
>> Why is the error return not checked?
>>
>>> +
>>> +		bdry = this->read_word(this->base + ONENAND_DATARAM);
>>> +		locked = bdry >> FLEXONENAND_PI_UNLOCK_SHIFT;
>>> +		locked = (locked == 0x3) ? 0 : 1;
>>> +		this->boundary[die] = bdry & FLEXONENAND_PI_MASK;
>>> +		this->boundary_locked[die] = locked;
>>> +		this->command(mtd, ONENAND_CMD_RESET, 0, 0);
>>> +		ret = this->wait(mtd, FL_RESETING);
>> Why is the error return not checked?
> 
> As per datasheet PI_ACCESS, PI_UPDATE, PI_READ and RESET always succeed.
> PI_ERASE and PI_WRITE can fail. Added error check for PI_ERASE.

So if the device is behaving correctly and the driver has no bugs and there
are no other related hardware errors, then 'ret' will always be zero.  Well,
I would check it anyway, but that's just me.

>>> +	if (FLEXONENAND(this)) {
>>> +		int boundary[] =
>>> +			{FLEXONENAND_DIE0_BOUNDARY, FLEXONENAND_DIE1_BOUNDARY};
>>> +		int lock[] =
>>> +			{FLEXONENAND_DIE0_ISLOCKED, FLEXONENAND_DIE1_ISLOCKED};
>>> +		unsigned die;
>>> +
>>> +		flexonenand_get_size(mtd);
>>> +
>>> +		/* Change the device boundaries if required */
>>> +		for (die = 0; die < this->dies; die++)
>>> +			if ((!this->boundary_locked[die]) &&
>>> +			   (boundary[die] >= 0) &&
>>> +			   (boundary[die] != this->boundary[die]))
>>> +				flexonenand_set_boundary(mtd, die,
>>> +						 boundary[die], lock[die]);
>> I am not sure how you intend FLEXONENAND_DIEx_BOUNDARY and FLEXONENAND_DIEx_ISLOCKED
>> to be used.  Obviously this code presently does nothing.  If you expect the values
>> to be configured for the device, then shouldn't they be config options?
> 
> Ok. Added config option for boundary and lock settings.
> Configuration of boundary / lock is optional. Default value in config is -1
> which will not change existing boundary of Flex-OneNAND.
> 
>> Also, ideally there should be a way for the platform driver to override them.
>>
> 
> Do you mean runtime configuration of boundary. Then we need to add some ioctl.
> 

No I mean a onenand driver (e.g. omap2.c) that reads the values from platform data
and wants to set them.  It is not important.  It can be done later by whomever needs it.

> diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
> index 9aa2a91..d23eeef 100644
> --- a/include/linux/mtd/onenand.h
> +++ b/include/linux/mtd/onenand.h
> @@ -17,8 +17,23 @@
>  #include <linux/mtd/onenand_regs.h>
>  #include <linux/mtd/bbm.h>
>  
> +#define MAX_DIES		2
>  #define MAX_BUFFERRAM		2
>  
> +#define FLEXONENAND_DIE0_BOUNDARY	CONFIG_MTD_FLEXONENAND_DIE0_BOUNDARY
> +#define FLEXONENAND_DIE1_BOUNDARY	CONFIG_MTD_FLEXONENAND_DIE1_BOUNDARY
> +

CONFIG_MTD_FLEXONENAND_DIEx_BOUNDARY are not necessarily defined i.e. you
need "#if defined ..." there as well.

I briefly tested the driver with an old 'non-Flex' OneNAND and it seemd to work
fine with no apparent effect on performance.  So I have no more issues :-)

Thanks
Adrian

  reply	other threads:[~2008-11-10 15:20 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-19 12:31 [ANNOUNCE] [PATCH] [MTD] Flex-OneNAND MTD Driver available AYYANARPONNUSAMY GANGHEYAMOORTHY
2008-09-22  7:11 ` Kyungmin Park
2008-09-22  7:11   ` Kyungmin Park
2008-09-24 12:35   ` apgmoorthy
2008-09-24 12:35     ` apgmoorthy
2008-09-26  0:31     ` Kyungmin Park
2008-09-26  0:31       ` Kyungmin Park
2008-09-26  4:51       ` Artem Bityutskiy
2008-09-26  4:51         ` Artem Bityutskiy
2008-09-26  5:30         ` Kyungmin Park
2008-09-26  5:30           ` Kyungmin Park
2008-09-26  6:26           ` Artem Bityutskiy
2008-09-26  6:26             ` Artem Bityutskiy
2008-09-26  8:01         ` Amit Kumar Sharma
2008-09-26  8:19           ` Artem Bityutskiy
2008-09-26  8:19             ` Artem Bityutskiy
2008-09-29  9:28             ` apgmoorthy
2008-09-29  9:28               ` apgmoorthy
2008-10-09 22:57               ` Kyungmin Park
2008-10-09 22:57                 ` Kyungmin Park
     [not found]                 ` <1224331498.6770.1362.camel@macbook.infradead.org>
2008-10-20  5:04                   ` apgmoorthy
2008-10-20  5:54                     ` Artem Bityutskiy
2008-10-22  6:43                       ` apgmoorthy
2008-10-24 14:26                         ` Adrian Hunter
2008-11-03 10:32                           ` apgmoorthy
2008-11-05  8:52                             ` Adrian Hunter
2008-11-07 14:26                               ` Rohit
2008-11-10 15:20                                 ` Adrian Hunter [this message]
2008-11-11  3:31                                   ` Amit Kumar Sharma
2008-11-11  7:28                                     ` Adrian Hunter
2008-11-12  5:43                                   ` Rohit
2008-10-20 10:53                     ` David Woodhouse
2008-10-21  5:22                   ` apgmoorthy
2008-10-10  6:34               ` David Woodhouse
2008-10-10  6:34                 ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2008-10-16  4:16 apgmoorthy
2008-10-16  4:28 ` Kyungmin Park
2008-10-16  4:28   ` Kyungmin Park
2008-10-20  3:01 ` Kyungmin Park

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=49185137.4040300@nokia.com \
    --to=ext-adrian.hunter@nokia.com \
    --cc=amitsharma.9@samsung.com \
    --cc=dwmw2@infradead.org \
    --cc=h.rohit@samsung.com \
    --cc=kmpark@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=moorthy.apg@samsung.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.