From: Stephen Hemminger <shemminger-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
power-072X8lT/F9NAfugRpC6u6w@public.gmane.org,
zambrano-dY08KVG/lbpWk0Htik3J/w@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] b44: power down PHY when interface down
Date: Sat, 30 Jun 2007 08:13:02 -0400 [thread overview]
Message-ID: <20070630081302.66b1d984@oldman> (raw)
In-Reply-To: <4354d3270706300447ladcda4by987b1f87963112f9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Sat, 30 Jun 2007 14:47:35 +0300
"Török Edvin" <edwintorok-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> When the interface is down (or driver removed), the BroadCom 44xx card remains
> powered on, and both its MAC and PHY is using up power.
> This patch makes the driver issue a MAC_CTRL_PHY_PDOWN when the interface
> is halted, and does a partial chip reset turns off the activity LEDs too.
>
> Applies to 2.6.22-rc6, or current git head.
>
> Tested on a Broadcom BCM4401-B0 card, it saves ~0.5W (measured using powertop).
>
> Signed-off-by: Torok Edwin <edwintorok-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> b44.c | 25 ++++++++++++++++++++-----
> 1 file changed, 20 insertions(+), 5 deletions(-)
> diff --git a/drivers/net/b44.c b/drivers/net/b44.c
> index 879a2ff..00d0f57 100644
> --- a/drivers/net/b44.c
> +++ b/drivers/net/b44.c
> @@ -113,6 +113,8 @@ static void b44_init_rings(struct b44 *);
> #define B44_FULL_RESET 1
> #define B44_FULL_RESET_SKIP_PHY 2
> #define B44_PARTIAL_RESET 3
> +#define B44_CHIP_RESET_FULL 4
> +#define B44_CHIP_RESET_PARTIAL 5
>
> static void b44_init_hw(struct b44 *, int);
>
> @@ -1283,7 +1285,7 @@ static void b44_clear_stats(struct b44 *bp)
> }
>
> /* bp->lock is held. */
> -static void b44_chip_reset(struct b44 *bp)
> +static void b44_chip_reset(struct b44 *bp, int reset_kind)
> {
> if (ssb_is_core_up(bp)) {
> bw32(bp, B44_RCV_LAZY, 0);
> @@ -1307,6 +1309,10 @@ static void b44_chip_reset(struct b44 *bp)
>
> b44_clear_stats(bp);
>
> + if (reset_kind == B44_CHIP_RESET_PARTIAL)
> + return;/* don't enable PHY if we are doing a partial reset
> + , we are probably going to power down */
> +
This is a non-standard formatting for comments, please follow
Coding style:
Linux style for comments is the C89 "/* ... */" style.
Don't use C99-style "// ..." comments.
The preferred style for long (multi-line) comments is:
/*
* This is the preferred style for multi-line
* comments in the Linux kernel source code.
* Please use it consistently.
*
* Description: A column of asterisks on the left side,
* with beginning and ending almost-blank lines.
*/
next prev parent reply other threads:[~2007-06-30 12:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-30 11:47 [PATCH] b44: power down PHY when interface down Török Edvin
2007-06-30 12:05 ` Matthew Garrett
2007-06-30 14:44 ` Arjan van de Ven
2007-06-30 15:19 ` Matthew Garrett
2007-06-30 15:25 ` Lennert Buytenhek
2007-07-01 13:02 ` Török Edvin
2007-06-30 16:42 ` PM policy, hotplug, power saving (was Re: [PATCH] b44: power down PHY when interface down) Jeff Garzik
2007-06-30 18:10 ` Stephen Hemminger
2007-06-30 18:31 ` PM policy, hotplug, power saving and WoL Henrique de Moraes Holschuh
2007-07-01 4:51 ` PM policy, hotplug, power saving (was Re: [PATCH] b44: power down PHY when interface down) Kyle Moffett
[not found] ` <4354d3270706300447ladcda4by987b1f87963112f9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-06-30 12:13 ` Stephen Hemminger [this message]
2007-07-01 12:49 ` [PATCH] b44: power down PHY when interface down Török Edvin
2007-07-01 12:55 ` Michael Buesch
2007-06-30 21:53 ` Michael Buesch
2007-06-30 22:03 ` Lennert Buytenhek
2007-06-30 22:24 ` Michael Buesch
2007-06-30 23:17 ` Lennert Buytenhek
2007-07-01 10:23 ` Michael Buesch
2007-07-01 15:00 ` Lennert Buytenhek
2007-07-01 15:29 ` Michael Buesch
2007-07-01 20:20 ` Michael Buesch
-- strict thread matches above, loose matches on Subject: below --
2007-07-01 13:25 Török Edvin
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=20070630081302.66b1d984@oldman \
--to=shemminger-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=power-072X8lT/F9NAfugRpC6u6w@public.gmane.org \
--cc=zambrano-dY08KVG/lbpWk0Htik3J/w@public.gmane.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).