netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org,
	leoli@freescale.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ucc_geth: add support for netpoll
Date: Sat, 27 Oct 2007 17:09:51 +0400	[thread overview]
Message-ID: <4723389F.7010109@ru.mvista.com> (raw)
In-Reply-To: <20071011124842.GB13963@localhost.localdomain>

Hello.

Anton Vorontsov wrote:

> This patch adds netpoll support for the QE UCC Gigabit Ethernet
> driver. The approach is very similar to the gianfar driver.

    It's rather contrarywise -- this is standard approach and gianfar with its 
3 TSEC IRQs has a quite non-standard poll_controller() implementation.

> Tested using netconsole.

    KGDBoE is considered a better test (I hope you've also tested with it).

> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> index 18a6f48..06807ce 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
>  	return IRQ_HANDLED;
>  }
>  
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +/*
> + * Polling 'interrupt' - used by things like netconsole to send skbs
> + * without having to re-enable interrupts. It's not called while
> + * the interrupt routine is executing.
> + */
> +static void ucc_netpoll(struct net_device *dev)
> +{
> +	struct ucc_geth_private *ugeth = netdev_priv(dev);
> +
> +	disable_irq(ugeth->ug_info->uf_info.irq);
> +	ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
> +	enable_irq(ugeth->ug_info->uf_info.irq);

    Why not make it less complex (for a reader and gcc too :-) ?

	struct ucc_geth_private *ugeth = netdev_priv(dev);
	int irq = ugeth->ug_info->uf_info.irq;

	disable_irq(irq);
	ucc_geth_irq_handler(irq, dev);
	enable_irq(irq);

> +}
> +#endif /* CONFIG_NET_POLL_CONTROLLER */
> +
>  /* Called when something needs to use the ethernet device */
>  /* Returns 0 for success. */
>  static int ucc_geth_open(struct net_device *dev)

WBR, Sergei

  reply	other threads:[~2007-10-27 13:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11 12:48 [PATCH] ucc_geth: add support for netpoll Anton Vorontsov
2007-10-27 13:09 ` Sergei Shtylyov [this message]
2007-10-27 14:37   ` Anton Vorontsov
2007-10-29  6:12     ` Li Yang-r58472
2007-10-29 12:17       ` Anton Vorontsov
2007-10-31 21:59         ` Anton Vorontsov
2007-11-01  2:33           ` Li Yang-r58472
2007-11-01 10:05             ` Anton Vorontsov

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=4723389F.7010109@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=avorontsov@ru.mvista.com \
    --cc=leoli@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=netdev@vger.kernel.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).