netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: dsaxena@plexity.net
Cc: netdev@vger.kernel.org, ralf@linux-mips.org, jeff@garzik.org,
	linux-mips@linux-mips.org, Manish Lachwani <mlachwani@mvista.com>
Subject: Re: [PATCH] Netpoll support for Sibyte MAC
Date: Tue, 20 Mar 2007 17:34:01 +0300	[thread overview]
Message-ID: <45FFF0D9.4020905@ru.mvista.com> (raw)
In-Reply-To: <20070319224311.GA10176@plexity.net>

Hello.

Deepak Saxena wrote:

> NETPOLL support for Sibyte MAC

> Index: linux-2.6.18/drivers/net/sb1250-mac.c
> ===================================================================
> --- linux-2.6.18.orig/drivers/net/sb1250-mac.c
> +++ linux-2.6.18/drivers/net/sb1250-mac.c
> @@ -1128,6 +1128,26 @@ static void sbdma_fillring(sbmacdma_t *d
>  	}
>  }
>  
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +static void sbmac_netpoll(struct net_device *netdev)
> +{
> +	struct sbmac_softc *sc = netdev_priv(netdev);
> +	int irq = sc->sbm_dev->irq;
> +
> +	__raw_writeq(0, sc->sbm_imr);
> +

    Thinking about it again, I'm not sure that blindly writing to the chip 
reg. to mask interrupts is SMP-safe enough (versus disable_irq()).  I know why 
it was done this way -- to quell the BUG emitted in the realtime mode on SMP 
-- because of scheduling with disabled interrupts in synchoronize_irq(), but 
after having spent much time on netpoll, I'm no longer sure that anything but 
disable_irq() is safe enough for SMP since -- otherwise there's no warranty 
that sbmac_intr() is not running on another CPU...

> +	sbmac_intr(irq, netdev, NULL);
> +
> +#ifdef CONFIG_SBMAC_COALESCE
> +	__raw_writeq(((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_TX_CH0) |
> +	((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_RX_CH0),
> +	sc->sbm_imr);
> +#else
> +	__raw_writeq((M_MAC_INT_CHANNEL << S_MAC_TX_CH0) | 
> +	(M_MAC_INT_CHANNEL << S_MAC_RX_CH0), sc->sbm_imr);
> +#endif
> +}
> +#endif

WBR, Sergei

  parent reply	other threads:[~2007-03-20 14:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 22:43 [PATCH] Netpoll support for Sibyte MAC Deepak Saxena
2007-03-20  1:22 ` Atsushi Nemoto
2007-03-20 18:35   ` Sergei Shtylyov
2007-03-20 13:38 ` Ralf Baechle
2007-03-20 14:34 ` Sergei Shtylyov [this message]
2007-03-23  5:58 ` Jeff Garzik

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=45FFF0D9.4020905@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=dsaxena@plexity.net \
    --cc=jeff@garzik.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mlachwani@mvista.com \
    --cc=netdev@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    /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).