From: Francois Romieu <romieu@fr.zoreil.com>
To: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Vineet Gupta <Vineet.Gupta1@synopsys.com>,
Mischa Jonker <Mischa.Jonker@synopsys.com>,
Arnd Bergmann <arnd@arndb.de>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <rob.herring@calxeda.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
"David S. Miller" <davem@davemloft.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
"joe@perches.com" <joe@perches.com>
Subject: Re: [PATCH v2] ethernet/arc/arc_emac - Add new driver
Date: Mon, 10 Jun 2013 00:15:08 +0200 [thread overview]
Message-ID: <20130609221508.GA12264@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <4881796E12491D4BB15146FE0209CE643F5CB230@DE02WEMBXB.internal.synopsys.com>
Alexey Brodkin <Alexey.Brodkin@synopsys.com> :
> On 06/08/2013 12:33 AM, Francois Romieu wrote:
> > Alexey Brodkin <Alexey.Brodkin@synopsys.com> :
[...]
> As replied to Joe I just want to name people contributed in this driver.
> What is a appropriate way to do it?
A polite way could be to see with contributors if it's ok for them to
appear in the (c) section.
[...]
> > You may #define (FRST_MASK | LAST_MASK)
>
> This combo is used in only 2 places so is it worth to introduce another
> define? With these (FRST_MASK | LAST_MASK) I suppose reader will
> understand that these are 2 separate bits. But still it might be just my
> vision and if #define (FRST_MASK | LAST_MASK) looks better then I'll add
> it immediately.
Your call. The #define only needs to appear in or near the function.
[...]
> >> + if (!skbnew) {
> >> + netdev_err(net_dev, "Out of memory, "
> >> + "dropping packet\n");
> >
> > Rate limit or do nothing.
>
> Not clear what do you mean. Could you please clarify ?
net_ratelimit() will prevent a storm of log messages. Actually I would
avoid the message completely.
[...]
> >> +{
> >> + struct arc_emac_priv *priv = netdev_priv(net_dev);
> >> +
> >> + napi_disable(&priv->napi);
> >> + netif_stop_queue(net_dev);
> >> +
> >> + /* Disable interrupts */
> >> + EMAC_REG_CLR(priv->reg_base_addr, R_ENABLE,
> >> + TXINT_MASK | /* Tx interrupt */
> >> + RXINT_MASK | /* Rx interrupt */
> >> + ERR_MASK | /* Error interrupt */
> >> + TXCH_MASK); /* Transmit chaining error interrupt */
> >
> > Useless comments.
>
> Is it clear that TXCH means "Transmit chaining error interrupt"?
ERR_TXCHAIN_MASK ?
> Or those defines should just have comments where they are defined and
> later just use them with no comments?
s/should have/may have/
Otherwise, yes.
[...]
> >> +static int arc_mdio_read(struct mii_bus *bus, int phy_addr, int
> reg_num)
> >> +{
> >> + int error;
> >> + unsigned int value;
> >> + struct arc_mdio_priv *priv = bus->priv;
> >
> > Revert the xmas tree.
>
> Not clear what does it mean? Could you please calrify?
struct arc_mdio_priv *priv = bus->priv;
unsigned int value;
int error;
[...]
> >> +struct arc_mdio_priv {
> >> + struct mii_bus *bus;
> >> + struct device *dev;
> >> + void __iomem *reg_base_addr; /* MAC registers base address */
> >> +};
> >
> > Overengineered ?
>
> Why so? Not clear, sorry.
Most of this struct is shared with the device private one. I am not
sure that they need to be separated.
[...]
> >> +#define EMAC_REG_SET(reg_base_addr, reg, val) \
> >> + iowrite32((val), reg_base_addr + reg * sizeof(int))
> >> +
> >> +#define EMAC_REG_GET(reg_base_addr, reg) \
> >> + ioread32(reg_base_addr + reg * sizeof(int))
> >
> > May use real non-caps functions.
>
> Do you mean to use "io{read|write}32" directly without macro?
Add your own arc_{r/w} functions and use the device private struct
pointer as one of their parameters (whence no void * parameter).
[...]
> Thanks a lot for this deep analisys.
Not that deep:
- arc_emac_tx should disable tx queue as soon as the tx ring is exhausted
- you may consider moving work from the irq handler to napi poll.
--
Ueimor
next prev parent reply other threads:[~2013-06-09 22:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 15:07 Alexey Brodkin
2013-06-07 15:39 ` Arnd Bergmann
2013-06-07 18:13 ` Joe Perches
2013-06-08 11:19 ` Alexey Brodkin
2013-06-08 11:23 ` Vineet Gupta
2013-06-07 20:32 ` Francois Romieu
2013-06-09 8:53 ` Alexey Brodkin
2013-06-09 22:15 ` Francois Romieu [this message]
2013-06-09 18:16 ` Andy Shevchenko
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=20130609221508.GA12264@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=Alexey.Brodkin@synopsys.com \
--cc=Mischa.Jonker@synopsys.com \
--cc=Vineet.Gupta1@synopsys.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@linaro.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=rob.herring@calxeda.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
all inboxes | Powered by JetHome®