From: Artem Bityutskiy <dedekind1@gmail.com>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3] mtd: Add DiskOnChip G3 support
Date: Tue, 20 Sep 2011 09:46:37 +0300 [thread overview]
Message-ID: <1316501205.4849.36.camel@sauron> (raw)
In-Reply-To: <1316454213-22559-1-git-send-email-robert.jarzmik@free.fr>
I really feel unsure about merging this driver because no one reviewed
it. On the surface it does look neat, though. Could you please CC lkml
on next submission?
On Mon, 2011-09-19 at 19:43 +0200, Robert Jarzmik wrote:
> +static void doc_delay(struct docg3 *docg3, int nbNOPs)
> +{
> + int i;
> +
> + doc_dbg("NOP x %d\n", nbNOPs);
> + for (i = 0; i < nbNOPs; i++)
> + doc_writeb(0, DoC_NOP);
> +}
Why you implement dalaying this way, instead of using udelay/mdelay?
> +static int doc_wait_ready(struct docg3 *docg3)
> +{
> + int maxWaitCycles = 100;
> +
> + do {
> + doc_delay(docg3, 4);
> + } while (!doc_is_ready(docg3) && maxWaitCycles--);
> + doc_delay(docg3, 2);
> + if (maxWaitCycles > 0)
> + return 0;
> + else
> + return -EIO;
> +}
There are things like cpu_relax() which are used in busy-loops - did you
look at those?
> +/*
> + * Debug sysfs entries
> + */
> +#ifdef CONFIG_DEBUG_FS
You do not need to use CONFIG_DEBUG_FS - debugfs makes all calls to be
noop if it is not present.
Either remove all macros or use DEBUG
> +#define DEBUGFS_RO_ATTR(name, show_fct) \
> + static int name##_open(struct inode *inode, struct file *file) \
> + { return single_open(file, show_fct, inode->i_private); } \
> + static const struct file_operations name##_fops = { \
> + .owner = THIS_MODULE, \
> + .open = name##_open, \
> + .llseek = seq_lseek, \
> + .read = seq_read, \
> + .release = single_release \
> + };
Hmm, looks like something which should be generic, not DoC-specific.
--
Best Regards,
Artem Bityutskiy
next parent reply other threads:[~2011-09-20 6:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1316454213-22559-1-git-send-email-robert.jarzmik@free.fr>
2011-09-20 6:46 ` Artem Bityutskiy [this message]
2011-09-20 15:44 ` [PATCH V3] mtd: Add DiskOnChip G3 support Robert Jarzmik
2011-09-21 6:08 ` 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=1316501205.4849.36.camel@sauron \
--to=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=robert.jarzmik@free.fr \
/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;
as well as URLs for NNTP newsgroup(s).