From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
Francois Romieu <romieu@fr.zoreil.com>,
Joe Perches <joe@perches.com>,
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 <devicetree-discuss@lists.ozlabs.org>,
Florian Fainelli <florian@openwrt.org>
Subject: Re: [PATCH v6] ethernet/arc/arc_emac - Add new driver
Date: Fri, 21 Jun 2013 07:05:44 +0000 [thread overview]
Message-ID: <4881796E12491D4BB15146FE0209CE643F5F4A8F@DE02WEMBXB.internal.synopsys.com> (raw)
In-Reply-To: CAHp75Vf8+z0B6PMjGqVNPuEJrVYiR-yMT5dvqqBAs=GA5utLrQ@mail.gmail.com
On 06/20/2013 08:00 PM, Andy Shevchenko wrote:
> On Thu, Jun 20, 2013 at 2:53 PM, Alexey Brodkin
>> + if ((info & FOR_EMAC) || !txbd->data)
>
> Redundant internal braces. Up to you.
I left them so priorities of operations will be obvious.
>> +#define FRST_OR_LAST_MASK (FRST_MASK | LAST_MASK)
>
> You may re-use it in *_tx_clean() above.
> Also, please use full English word FIRST. Actually is there any
> conflicts with existing drivers? Should it be with [ARC_]EMAC prefix?
Re-used it in 2 mentioned places. And changed FRST with FIRST.
I don't see defines with the same name anywhere else.
>
>> + /* Make sure pointer to data buffer is set */
>> + mb();
>
> I'm not so familiar with memory barriers, but is this somehow differ
> from smp_mb()?
> Which one suits better? And what about the other places in this file?
Since for now driver itself is not SMP-safe so I don't see any reason
for "smp_" barriers. Later I plan to add SMP compatibility and that this
point barriers will be replaced as well.
Another thing is I switched to "wmb()" (which is a barrier fror write in
particular) instead of generic "mb()".
>> + /* Allocate Tx BD's similar to Rx BD's. All Tx BD's owned by CPU */
>> + bd = priv->txbd;
>> + for (i = 0; i < TX_BD_NUM; i++) {
>> + bd->data = 0;
>> + bd->info = 0;
>> + bd++;
>> + }
>
> Looks like
> memset(priv->txbd, 0, siezeof(*priv->txbd) * TX_BD_NUM);
Correct.
>> + /* Get "info" of the next BD */
>
>> + /* Get PHY from device tree */
>> + phy_node = of_parse_phandle(pdev->dev.of_node, "phy", 0);
>
>> + /* Get EMAC registers base address from device tree */
>> + err = of_address_to_resource(pdev->dev.of_node, 0, &res_regs);
>
>> + /* Get CPU clock frequency from device tree */
>> + if (of_property_read_u32(pdev->dev.of_node, "clock-frequency",
>> + &clock_frequency)) {
>
>> + /* Get IRQ from device tree */
>> + err = of_irq_to_resource(pdev->dev.of_node, 0, &res_irq);
>
> So, you don't like the idea to get as much as possible before
> alloc_netdev(), don't you?
Ok, I did this change)))
Regards,
Alexey
prev parent reply other threads:[~2013-06-21 7:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 11:53 [PATCH v6] ethernet/arc/arc_emac - Add new driver Alexey Brodkin
2013-06-20 16:00 ` Andy Shevchenko
2013-06-20 16:12 ` Andy Shevchenko
2013-06-21 7:05 ` Alexey Brodkin [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=4881796E12491D4BB15146FE0209CE643F5F4A8F@DE02WEMBXB.internal.synopsys.com \
--to=alexey.brodkin@synopsys.com \
--cc=Mischa.Jonker@synopsys.com \
--cc=Vineet.Gupta1@synopsys.com \
--cc=andy.shevchenko@gmail.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=florian@openwrt.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 \
--cc=romieu@fr.zoreil.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;
as well as URLs for NNTP newsgroup(s).