public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Claudio Lanconelli <lanconelli.claudio@eptar•com>
To: netdev@vger•kernel.org
Cc: David Brownell <david-b@pacbell•net>
Subject: Re: [patch 2.6.24-git] net/enc28j60: oops fix, low power mode
Date: Wed, 06 Feb 2008 18:11:30 +0100	[thread overview]
Message-ID: <47A9EA42.3080800@eptar.com> (raw)
In-Reply-To: <20080205190124.E72F48E45F@adsl-69-226-248-13.dsl.pltn13.pacbell.net>

David Brownell wrote:
> From: David Brownell <dbrownell@users•sourceforge.net>
>
> Prevent unaligned packet oops on enc28j60 packet RX.
>   
How can I reproduce the unaligned packet oops? Did you use any utilities 
to force this condition?
> Keep enc28j60 chips in low-power mode when they're not in use.
> At typically 120 mA, these chips run hot even when idle.  Low
> power mode cuts that power usage by a factor of around 100.
>   
Good idea, but with your patch applied, after some ifconfig down - 
ifconfig up cycle, the
enc28j60 is left in an unknown state and it doesn' Rx/Tx anything.
In such cases If I dump the counters with ifconfig I got rx error 
counter > 0 and the RX and TX packets counters are freezed.
Actually I don't know what causes the freeze, it needs investigation. 
The cause can be the rx error condition or the power down/up commands.
May be receiving packets while it's going to wakeup causes problems.

Can you split the patch in 2 parts, unaligned rx and power save?

> +/*
> + * Low power mode shrinks power consumption about 100x, so we'd like
> + * the chip to be in that mode whenever it's inactive.
> + */
> +static void enc28j60_lowpower(struct enc28j60_net *priv, bool is_low)
> +{
> +	int	tmp;
> +
> +	dev_dbg(&priv->spi->dev, "%s power...\n", is_low ? "low" : "high");
>   
use
if(netif_msg_drv(priv)) printk(...
instead of dev_dbg(), please.
Doing so we can switch on/off messages runtime using ethtool.

> +
> +	mutex_lock(&priv->lock);
> +	if (is_low) {
> +		nolock_reg_bfclr(priv, ECON1, ECON1_RXEN);
> +		for (;;) {
> +			tmp = nolock_regb_read(priv, ESTAT);
> +			if (!(tmp & ESTAT_RXBUSY))
> +				break;
> +		}
>   
Avoid infinite waiting loops, please.
Look at enc28j60_phy_read() for example.
> +		for (;;) {
> +			tmp = nolock_regb_read(priv, ECON1);
> +			if (!(tmp & ECON1_TXRTS))
> +				break;
> +		}
>   
idem
> +		/* ECON2_VRPS was set during initialization */
> +		nolock_reg_bfset(priv, ECON2, ECON2_PWRSV);
> +	} else {
> +		nolock_reg_bfclr(priv, ECON2, ECON2_PWRSV);
> +		for (;;) {
> +			tmp = nolock_regb_read(priv, ESTAT);
> +			if (tmp & ESTAT_CLKRDY)
> +				break;
> +		}
>   
idem


  reply	other threads:[~2008-02-06 17:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05 19:01 [patch 2.6.24-git] net/enc28j60: oops fix, low power mode David Brownell
2008-02-06 17:11 ` Claudio Lanconelli [this message]
2008-02-06 17:33   ` [patch 2.6.24-git] net/enc28j60: oops fix David Brownell
2008-02-07 10:24     ` Claudio Lanconelli
2008-02-19 20:52       ` [RESEND/patch 2.6.25-rc2-git] " David Brownell
2008-03-05  1:17       ` [RE(*2)SEND/patch " David Brownell
2008-03-06  2:52         ` David Miller
2008-03-06  3:05           ` David Brownell
2008-02-06 18:19   ` [patch 2.6.24-git] net/enc28j60: low power mode David Brownell
2008-02-07 10:49     ` Claudio Lanconelli
2008-02-07  5:56   ` [patch 2.6.24-git] net/enc28j60: oops fix, " David Brownell
2008-02-07 10:53     ` Claudio Lanconelli
2008-02-10 17:54       ` David Brownell
2008-02-11 12:07         ` Claudio Lanconelli
2008-02-11 20:23           ` David Brownell
2008-02-14 10:28             ` Claudio Lanconelli
2008-02-07  6:08   ` [patch 2.6.24-git] net/enc28j60: " David Brownell
2008-02-07 11:21     ` Claudio Lanconelli
2008-02-10 17:45       ` David Brownell
2008-02-10 17:46       ` David Brownell
2008-02-07  6:08   ` [patch 2.6.24-git] net/enc28j60: section fix David Brownell
2008-02-07 11:13     ` Claudio Lanconelli
2008-02-19 20:54       ` [RESEND/patch 2.6.25-rc2-git] net/enc28j60: low power mode David Brownell
2008-02-19 20:56       ` [RESEND/patch 2.6.25-rc2-git] net/enc28j60: section fix David Brownell
2008-04-19  2:08       ` [RESEND/patch 2.6.25] " David Brownell
2008-04-19  2:08       ` [RESEND/patch 2.6.25] net/enc28j60: low power mode David Brownell

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=47A9EA42.3080800@eptar.com \
    --to=lanconelli.claudio@eptar$(echo .)com \
    --cc=david-b@pacbell$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /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