netdev.vger.kernel.org archive mirror
 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: low power mode
Date: Thu, 07 Feb 2008 11:49:01 +0100	[thread overview]
Message-ID: <47AAE21D.30606@eptar.com> (raw)
In-Reply-To: <20080206181912.6E2E08E152@adsl-69-226-248-13.dsl.pltn13.pacbell.net>

David Brownell wrote:
> The driver seemed to already have some goofage there:
>
>   # ifconfig eth1 up
>   net eth1: link down
>   net eth1: link down
>   net eth1: normal mode
>   net eth1: multicast mode
>   net eth1: multicast mode
>   #
>
>   
Without low power patch I have:

# ifconfig eth0 up
net eth0: link down
net eth0: normal mode
net eth0: multicast mode
net eth0: multicast mode
# net eth0: link up - Half duplex

> I'd normally expect it not to go down when told to go up, and
> then only to do the multicast thing once ...
>   
multicast is called by network stacks, no control by the driver. The driver
just print message.
I don't know why enc28j60_set_multicast_list() are called more than once.

When you do an ifconfig up the driver reset the chip, so you see link down
before link up message.

>
>   
>> 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.
>>     
>
> The enc28j60_setlink() was odd too.  It insists the link be down
> before changing duplex, then brings the link up ... so I had to
> put it down again to maintain the "lowpower if not up" invariant.
>
> But the way it brings the link up is to enc28j60_hw_init(), which
> it also does when bringing the link up.  So there's no need to
> bring the link up when changing duplex ...
>
>
>   
I don't follow you anymore.
To change duplex mode the link must be down.
enc28j60_setlink() reinitialize the chip with new duplex mode,
enc28j60_hw_init() never brings link up.

I propose you to add set_lowpower(true) in the enc28j60_probe() and in 
the enc28j60_net_close() after enc28j60_hw_disable().
Probably we don't need to set_lowpower(false) in enc28j60_net_open() since
it performs a soft reset with enc28j60_hw_init().
Do you agree?


>>
>> use
>> if(netif_msg_drv(priv)) ...
>> Doing so we can switch on/off messages runtime using ethtool.
>>     
>
> OK, although there's still a role for "-DDEBUG" compile-time
> mesage removal.
>
>   
It's ok to use

if(netif_msg_drv(priv)) dev_dbv(...


> This driver also abuses __FUNCTION__ (general policy:  don't use it)
>   
Why?
> Then there should be a single routine for all such busy-wait loops,
> so each such usage doesn't need to be open-coded.  Less space, and
> more obviously correct.  I'll add one and make phy_read() use it too.
>
>   
Ok


  reply	other threads:[~2008-02-07 10:48 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
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 [this message]
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=47AAE21D.30606@eptar.com \
    --to=lanconelli.claudio@eptar.com \
    --cc=david-b@pacbell.net \
    --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).