Sorry for the confusion, I'll try to clarify.

On Wed, 5 Nov 2014, Ritesh Raj Sarraf wrote:

On 11/05/2014 11:02 AM, Matthew Gabeler-Lee wrote:
On at least my system (r8169 driver), any time ethtool is called to set the
advertised link speed, it causes a momentary loss of carrier.  This causes
l-m-t to incorrectly think the link was not in use, and shut it off.

What do you mean by "shut it off" ?
I believe the ethernet is disabled, while on battery, only if the
corresponding setting is enabled in the config file.

By shut it off, I mean running "ip link set dev eth0 down" to disable the
interface -- /usr/share/laptop-mode-tools/modules/ethernet line 131.

On a related note, the invocation of ethtool doesn't work at all on at least
that chipset.  Apparently it is necessary to include the duplex setting as
well.  Not including the duplex setting causes ethtool to emit "Cannot
advertise speed X" ...  but still causes the momentary carrier loss.  I
don't know if this requirement/limitation is specific to the r8169 driver.
Including the duplex setting allows it to actually restrict the link speed.

I'm not sure what you mean here. Works for me..

I think my hardware may have some limitations around the speed changing that
yours does not have.

The only catch you'll notice is that while on AC, my wired ethernet is
10Mb/s where as on BATT, it is 1000Mb/s.

This seems bass ackwards?  Wouldn't you want the on battery state to be the
low speed to save power?  That's not really relevant to my problem though.

Running "ethtools -s eth0 speed 10" (or any other value for the speed) fails
to set the speed limit on my system.  In order to set the speed limit on my
system, you must also specify the duplex setting -- "ethtool -s eth0
speed 10 duplex full" works properly, as does "... duplex half".

# when no carrier is detected on the interface (e.g., no active cable is
# plugged in).

This is the other / more important aspect that is not working properly for
me.

Because of the call to ethtool to set the speed, it always sees NO-CARRIER
when it checks this.  This temporary NO-CARRIER state happens even if the
ethtool call gives the error described above, or if it succeeds, and even if
the speed set is the same as the current speed.

Switching the order of the "Handle throttling" and "Shut down interface"
sections in the ethernet module script would be sufficient to fix the issue,
at least as far as it can be fixed within the limitations of my hardware.

I don't think there's any way to fix the link loss every time the speed is
set from l-m-t without breaking other systems.  I think that would need to
be fixed in the driver, if possible ...  it may be a limitation of the
hardware.

--
        -Matt
"Reality is that which, when you stop believing in it, doesn't go away".
                -- Philip K. Dick
GPG pubkey fingerprint: A57F B354 FD30 A502 795B 9637 3EF1 3F22 A85E 2AD1


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to