linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
Cc: linuxppc-dev@ozlabs.org, Sean MacLennan <smaclennan@pikatech.com>
Subject: Re: mal_probe crash
Date: Sat, 10 Jan 2009 08:09:40 +1100	[thread overview]
Message-ID: <1231535380.2142.68.camel@pasglop> (raw)
In-Reply-To: <200901091549.56943.matthias.fuchs@esd-electronics.com>


> Could it be that simple. Probably not. It works at a first glace on
> a 405EP ang GPr board. But it might cause problems when having more than 
> one EMAC up at the same time.

I talked with the network folks and that should be ok.

We only need to be a bit careful in case for some reason the EMAC we
linked to NAPI get removed/destroyed... We only do all at once for now
but heh..

Ben.

> Matthias
> 
> [PATCH] powerpc: Fix ibm_newemac driver
> 
> Since commit d565b0a1a9b6ee7d netif_napi_add must be called
> if a proper net_device pointer != NULL.
> 
> Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
> ---
>  drivers/net/ibm_newemac/core.c |    3 +++
>  drivers/net/ibm_newemac/mal.c  |    5 +----
>  drivers/net/ibm_newemac/mal.h  |    1 +
>  3 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
> index 87a7066..9bd4d6d 100644
> --- a/drivers/net/ibm_newemac/core.c
> +++ b/drivers/net/ibm_newemac/core.c
> @@ -2767,6 +2767,9 @@ static int __devinit emac_probe(struct of_device *ofdev,
>  	if (dev->mdio_dev != NULL)
>  		dev->mdio_instance = dev_get_drvdata(&dev->mdio_dev->dev);
>  
> +	netif_napi_add(ndev, &dev->mal->napi, mal_poll,
> +		       CONFIG_IBM_NEW_EMAC_POLL_WEIGHT);
> +
>  	/* Register with MAL */
>  	dev->commac.ops = &emac_commac_ops;
>  	dev->commac.dev = dev;
> diff --git a/drivers/net/ibm_newemac/mal.c b/drivers/net/ibm_newemac/mal.c
> index ecf9798..d5306ae 100644
> --- a/drivers/net/ibm_newemac/mal.c
> +++ b/drivers/net/ibm_newemac/mal.c
> @@ -391,7 +391,7 @@ void mal_poll_enable(struct mal_instance *mal, struct mal_commac *commac)
>  	napi_schedule(&mal->napi);
>  }
>  
> -static int mal_poll(struct napi_struct *napi, int budget)
> +int mal_poll(struct napi_struct *napi, int budget)
>  {
>  	struct mal_instance *mal = container_of(napi, struct mal_instance, napi);
>  	struct list_head *l;
> @@ -613,9 +613,6 @@ static int __devinit mal_probe(struct of_device *ofdev,
>  	INIT_LIST_HEAD(&mal->list);
>  	spin_lock_init(&mal->lock);
>  
> -	netif_napi_add(NULL, &mal->napi, mal_poll,
> -		       CONFIG_IBM_NEW_EMAC_POLL_WEIGHT);
> -
>  	/* Load power-on reset defaults */
>  	mal_reset(mal);
>  
> diff --git a/drivers/net/ibm_newemac/mal.h b/drivers/net/ibm_newemac/mal.h
> index 2f0a873..51597bd 100644
> --- a/drivers/net/ibm_newemac/mal.h
> +++ b/drivers/net/ibm_newemac/mal.h
> @@ -282,6 +282,7 @@ void mal_disable_rx_channel(struct mal_instance *mal, int channel);
>  
>  void mal_poll_disable(struct mal_instance *mal, struct mal_commac *commac);
>  void mal_poll_enable(struct mal_instance *mal, struct mal_commac *commac);
> +int mal_poll(struct napi_struct *napi, int budget);
>  
>  /* Add/remove EMAC to/from MAL polling list */
>  void mal_poll_add(struct mal_instance *mal, struct mal_commac *commac);

      parent reply	other threads:[~2009-01-09 21:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 20:44 mal_probe crash Sean MacLennan
2009-01-08 20:46 ` Josh Boyer
2009-01-07 22:50   ` Benjamin Herrenschmidt
2009-01-09 14:42     ` Geert Uytterhoeven
2009-01-09 22:34       ` Herbert Xu
2009-01-09 23:13         ` Benjamin Herrenschmidt
2009-01-09 14:49     ` Matthias Fuchs
2009-01-09 15:02       ` Matthias Fuchs
2009-01-09 15:24         ` Geert Uytterhoeven
2009-01-09 21:30           ` Benjamin Herrenschmidt
2009-01-09 22:01             ` Roland Dreier
2009-01-12 13:37               ` Geert Uytterhoeven
2009-01-12 21:36                 ` Benjamin Herrenschmidt
2009-01-12 22:48                   ` Josh Boyer
2009-01-12 22:51                   ` Re[2]: " Yuri Tikhonov
2009-01-13  2:52                     ` Benjamin Herrenschmidt
2009-01-13 16:19                     ` Geert Uytterhoeven
2009-01-09 21:09       ` Benjamin Herrenschmidt [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=1231535380.2142.68.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=matthias.fuchs@esd-electronics.com \
    --cc=smaclennan@pikatech.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).