2007-11-26 16:18:22

by Miguel Botón

[permalink] [raw]
Subject: Re: [PATCH 2/2] iwlwifi: add power management support -v2

On Saturday 17 November 2007 07:15:05 Tomas Winkler wrote:
> Why power management shouldn't be enabled while in AC? The semantic o=
f this
> ioctls is quite unclear.

IWL_POWER_AC and IWL_POWER_BATTERY are just two power modes. IWL_POWER_=
AC=20
would be the default power mode when we're in AC (no power saving) and=20
IWL_POWER_BATTERY would be the default power mode when we're in battery=
=20
(power saving mode). That's why we set IWL_POWER_ENABLED flag with=20
IWL_POWER_BATTERY, because it is the only power mode that saves power.

We can change to IWL_POWER_BATTERY or IWL_POWER_AC in any moment.

This patch, depending if power management is enabled or not, sets which=
power=20
mode we should use, Then, it checks if we're already using this mode or=
not.

--=20
Miguel Bot=F3n


2007-11-26 17:11:55

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 2/2] iwlwifi: add power management support -v2

On Nov 26, 2007 6:18 PM, Miguel Bot=F3n <[email protected]> wrote:
>
> On Saturday 17 November 2007 07:15:05 Tomas Winkler wrote:
> > Why power management shouldn't be enabled while in AC? The semantic=
of this
> > ioctls is quite unclear.
>
I
> IWL_POWER_AC and IWL_POWER_BATTERY are just two power modes. IWL_POWE=
R_AC
> would be the default power mode when we're in AC (no power saving) an=
d
> IWL_POWER_BATTERY would be the default power mode when we're in batte=
ry
> (power saving mode). That's why we set IWL_POWER_ENABLED flag with
> IWL_POWER_BATTERY, because it is the only power mode that saves power=
=2E
>
> We can change to IWL_POWER_BATTERY or IWL_POWER_AC in any moment.
>
> This patch, depending if power management is enabled or not, sets whi=
ch power
> mode we should use, Then, it checks if we're already using this mode =
or not.
>
I'm not sure who introduced this names (lazy to look to history) but
that's very misleading. Nothing says that while in
AC we cannot do power saving and vice versa. This naming is scattered
all over the code, there should be only one place where AC and BATTERY
are translated into appropriate (maybe configurable) power levels. We
have 5 power levels defined for iwlwifi.

Tomas

> --
> Miguel Bot=F3n
>

2007-11-26 17:19:27

by Dan Williams

[permalink] [raw]
Subject: Re: [PATCH 2/2] iwlwifi: add power management support -v2

On Mon, 2007-11-26 at 19:11 +0200, Tomas Winkler wrote:
> On Nov 26, 2007 6:18 PM, Miguel Bot=C3=B3n <[email protected]> wr=
ote:
> >
> > On Saturday 17 November 2007 07:15:05 Tomas Winkler wrote:
> > > Why power management shouldn't be enabled while in AC? The semant=
ic of this
> > > ioctls is quite unclear.
> >
> I
> > IWL_POWER_AC and IWL_POWER_BATTERY are just two power modes. IWL_PO=
WER_AC
> > would be the default power mode when we're in AC (no power saving) =
and
> > IWL_POWER_BATTERY would be the default power mode when we're in bat=
tery
> > (power saving mode). That's why we set IWL_POWER_ENABLED flag with
> > IWL_POWER_BATTERY, because it is the only power mode that saves pow=
er.
> >
> > We can change to IWL_POWER_BATTERY or IWL_POWER_AC in any moment.
> >
> > This patch, depending if power management is enabled or not, sets w=
hich power
> > mode we should use, Then, it checks if we're already using this mod=
e or not.
> >
> I'm not sure who introduced this names (lazy to look to history) but
> that's very misleading. Nothing says that while in
> AC we cannot do power saving and vice versa. This naming is scattered
> all over the code, there should be only one place where AC and BATTER=
Y
> are translated into appropriate (maybe configurable) power levels. W=
e
> have 5 power levels defined for iwlwifi.

At some point everyone needs to standardize on power levels so that
userland has a hope of mapping the right state to the right power level
in the driver. Otherwise, we get into a situation where broadcom power
levels don't map the same way iwl powerlevels do, and then we can't eve=
r
do the right thing.

dan

> Tomas
>=20
> > --
> > Miguel Bot=C3=B3n
> >
> -
> To unsubscribe from this list: send the line "unsubscribe linux-wirel=
ess" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2007-11-26 17:33:21

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 2/2] iwlwifi: add power management support -v2

>
> At some point everyone needs to standardize on power levels so that
> userland has a hope of mapping the right state to the right power lev=
el
> in the driver. Otherwise, we get into a situation where broadcom pow=
er
> levels don't map the same way iwl powerlevels do, and then we can't e=
ver
> do the right thing.
>
Agree, these are just misleading names IMHO.

> dan
>
> > Tomas
>
> >
> > > --
> > > Miguel Bot=F3n
> > >
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-wir=
eless" in
> > the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>