]> asedeno.scripts.mit.edu Git - linux.git/commit
r8169: improve runtime pm in general and suspend unused ports
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 8 Jan 2018 20:39:13 +0000 (21:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jan 2018 17:38:56 +0000 (12:38 -0500)
commita92a08499b1f9d74eb5ed77ea04c0e42aab46e9a
tree46d34ba391ffe226686525343fa2d688870d332b
parentef4d5fccebe9253fd2c934b7a1119c9c9f2b9306
r8169: improve runtime pm in general and suspend unused ports

So far rpm doesn't cover cases like unused ports which are never
brought up. If they are active at probe time they remain in this state.
Included in this patch:

- Let the idle notification check whether we can suspend and let it
  schedule the suspend. This way we don't need to have calls to
  pm_schedule_suspend in different places.

- At the end of rtl_open and rtl_init_one send an idle notification
  to allow suspending if the link is down. If a cable is plugged in
  aneg is finished before the suspend timer expires and the suspend
  request is cancelled.

- Change rtl8169_runtime_suspend to power down the chip if the
  interface is down.

Successfully tested on a RTL8168evl (mac version 34).

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169.c