public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: "Changming Chen (changmingche)" <changmingche@micron.com>
Cc: "dwmw2@infradead.org" <dwmw2@infradead.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"Youxin He \(youxinhe\)" <youxinhe@micron.com>,
	"Frank Liu \(frankliu\)" <frankliu@micron.com>
Subject: Re: Patch MTD: increase time out value for buffer program
Date: Tue, 26 Jun 2012 18:58:54 +0300	[thread overview]
Message-ID: <1340726334.3119.150.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <6ACDE3A4C2F7E94C8DBB6FCC0D06A0873DA88046@NTXBOIMBX05.micron.com>

[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]

On Wed, 2012-06-13 at 04:29 +0000, Changming Chen (changmingche) wrote:
> The time out value(1ms:typical HZ defined smaller than 1000) defined for function "do_write_buffer" in "cfi_cmdset_0002.c" is not enough. Because the enlargement of buffer size, much time will cost for buffer program. It's has risk that time out will be triggered before buffer program finished and make misjudge for buffer program. we suggest that 4ms is more appropriate compare to 1ms. This change has no impact of program performance.
> 
> diff --git a/a/drivers/mtd/chips/cfi_cmdset_0002.c b/b/drivers/mtd/chips/cfi_cmd
> index 9d93c45..7da8fca 100755
> --- a/a/drivers/mtd/chips/cfi_cmdset_0002.c
> +++ b/b/drivers/mtd/chips/cfi_cmdset_0002.c
> @@ -1312,7 +1312,7 @@ static int __xipram do_write_buffer(struct map_info *map, 
>          struct cfi_private *cfi = map->fldrv_priv;
>          unsigned long timeo = jiffies + HZ;
>          /* see comments in do_write_oneword() regarding uWriteTimeo. */
> -        unsigned long uWriteTimeout = ( HZ / 1000 ) + 1;
> +        unsigned long uWriteTimeout = ( HZ / 1000 ) + 4;

No, sorry, this is not a fix, this is a band-aid. The whole HZ/1000
thing is broken. You should not use HZ at all. For this driver it looks
like you should use ' schedule_timeout()' with the right timout instead
of 'schedule()' and get rid of all the HZ and jiffies stuff.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-06-26 15:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.0.1338988276.11201.linux-mtd@lists.infradead.org>
2012-06-13  4:29 ` Patch MTD: increase time out value for buffer program Changming Chen (changmingche)
2012-06-26 15:58   ` Artem Bityutskiy [this message]
2012-06-27  3:27     ` Artem Bityutskiy
2012-06-27  5:23       ` Youxin He (youxinhe)
2012-06-27 10:33         ` 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=1340726334.3119.150.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=changmingche@micron.com \
    --cc=dwmw2@infradead.org \
    --cc=frankliu@micron.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=youxinhe@micron.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox