From: Artem Bityutskiy <dedekind1@gmail.com>
To: "Youxin He (youxinhe)" <youxinhe@micron.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
"Changming Chen \(changmingche\)" <changmingche@micron.com>,
"dwmw2@infradead.org" <dwmw2@infradead.org>,
"Frank Liu \(frankliu\)" <frankliu@micron.com>
Subject: RE: Patch MTD: increase time out value for buffer program
Date: Wed, 27 Jun 2012 13:33:07 +0300 [thread overview]
Message-ID: <1340793187.29342.43.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <567E14D9F917DD43923114D48B1586363D569F2F@NTXBOIMBX01.micron.com>
[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]
On Wed, 2012-06-27 at 05:23 +0000, Youxin He (youxinhe) wrote:
> Hi Artem,
> How about just change HZ/1000 stuff to msecs_to_jiffies()? Schedule_timeout() is a good idea but I don't see it is necessary to use schedule_timeout() to replace schedule(). The code you add below is just for suspend case, normal case will not go to schedule(), but normal case you should check for timeout otherwise infinite loop in case a program failure occur.
>
> + #define WRITE_TIEMEOUT 4
> .......
> - unsigned long uWriteTimeout = ( HZ / 1000 ) + 1;
> + unsigned long uWriteTimeout = msecs_to_jiffies(WRITE_TIEMEOUT);
I think that the current code simply buggy and needs to be re-wised.
E.g., what is this:
timeo = jiffies + (HZ / 2); /* FIXME */
mutex_lock(&chip->mutex);
...
if (time_after(jiffies, timeo) && !chip_ready(map, adr)){
What if we are not able to grab the mutex for longer than "HZ/2".
So I suggest you to try to come-up with the general clean-up of the
timeouts in this driver. AFAICS, but not sure because did not think hard
enough, schedule_tiemout() could be use in most places in this driver.
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2012-06-27 10:29 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
2012-06-27 3:27 ` Artem Bityutskiy
2012-06-27 5:23 ` Youxin He (youxinhe)
2012-06-27 10:33 ` Artem Bityutskiy [this message]
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=1340793187.29342.43.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