public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Roland Stigge <stigge@antcom•de>
To: Ben Hutchings <bhutchings@solarflare•com>
Cc: davem@davemloft•net, jeffrey.t.kirsher@intel•com,
	alexander.h.duyck@intel•com, eilong@broadcom•com,
	ian.campbell@citrix•com, netdev@vger•kernel.org,
	w.sang@pengutronix•de, linux-kernel@vger•kernel.org,
	kevin.wells@nxp•com, linux-arm-kernel@lists•infradead.org,
	arnd@arndb•de, baruch@tkos•co.il, joe@perches•com
Subject: Re: [PATCH v4] lpc32xx: Added ethernet driver: smp_wmb()
Date: Tue, 06 Mar 2012 11:43:57 +0100	[thread overview]
Message-ID: <4F55EA6D.3070602@antcom.de> (raw)
In-Reply-To: <1330987524.2538.61.camel@bwh-desktop>

On 03/05/2012 11:45 PM, Ben Hutchings wrote:
>> +	/* Clear and enable interrupts */
>> +	writel(0xFFFF, LPC_ENET_INTCLEAR(pldat->net_base));
>> +	lpc_eth_enable_int(pldat->net_base);
>> +
>> +	/* Get the next TX buffer output index */
>> +	pldat->num_used_tx_buffs = 0;
>> +	pldat->last_tx_idx =
>> +		readl(LPC_ENET_TXCONSUMEINDEX(pldat->net_base));
> 
> Doesn't this need to be done *before* enabling interrupts?  Also, I
> think you need an smp_wmb() so that the interrupt handler is guaranteed
> to see all these writes.

Do you mean _one_ smp_wmb() directly after lpc_eth_enable_int() (which
I'm moving behind the above code?

Note that there is no SMP in LPCs and NXP is not planning to build one
AFAIK. However, I'm fine with including smp_wmb() anyway for completeness.

Thanks in advance,

Roland

  parent reply	other threads:[~2012-03-06 10:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 21:40 [PATCH v4] lpc32xx: Added ethernet driver Roland Stigge
2012-03-05 22:45 ` Ben Hutchings
2012-03-06  0:49   ` Eric Dumazet
2012-03-06  1:26     ` Ben Hutchings
2012-03-06  8:53   ` Roland Stigge
2012-03-06 12:13     ` Eric Dumazet
2012-03-06 10:43   ` Roland Stigge [this message]
2012-03-06 14:03     ` [PATCH v4] lpc32xx: Added ethernet driver: smp_wmb() Ben Hutchings
2012-03-06 14:17       ` Russell King - ARM Linux
2012-03-06 15:37         ` Ben Hutchings

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=4F55EA6D.3070602@antcom.de \
    --to=stigge@antcom$(echo .)de \
    --cc=alexander.h.duyck@intel$(echo .)com \
    --cc=arnd@arndb$(echo .)de \
    --cc=baruch@tkos$(echo .)co.il \
    --cc=bhutchings@solarflare$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eilong@broadcom$(echo .)com \
    --cc=ian.campbell@citrix$(echo .)com \
    --cc=jeffrey.t.kirsher@intel$(echo .)com \
    --cc=joe@perches$(echo .)com \
    --cc=kevin.wells@nxp$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=w.sang@pengutronix$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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