lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 4 Jan 2012 23:07:14 +0100
From:	Francois Romieu <romieu@...zoreil.com>
To:	Olof Johansson <olof@...om.net>
Cc:	tbroch@...omium.org, David Miller <davem@...emloft.net>,
	nic_swsd@...ltek.com, netdev@...r.kernel.org,
	Hayes Wang <hayeswang@...ltek.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>
Subject: Re: [PATCH] r8169: Enable suspend when device is idle from boot.

Olof Johansson <olof@...om.net> :
> On Tue, Jan 3, 2012 at 3:30 PM, Francois Romieu <romieu@...zoreil.com> wrote:
> > Francois Romieu <romieu@...zoreil.com> :
> > [...]
> >> The description of the patch implies that the initial power management
> >> state is not right. I would be more inclined to set it correctly when
> >> the device goes up instead of checking repeatedly for a loss of sync
> >> through rtl8169_runtime_idle. Todd, any comment ?
> >
> > ... which could be as simple as (completely untested) :
> 
> That change is just to the code path of open(), which means that for
> the power savings to kick in, you have to bring the interface up. The
> point of the original patch is to check even if the interface has
> never been touched.

Fair enough.

If so the original patch should not be needed as the driver core is
supposed to invoke the idle callback after probe (aka rtl8169_init_one).
After probe the device is in TxDescArray == 0 state and rtl8169_runtime_idle
returns 0. pm_runtime_suspend should thus be called [*]... I must have
missed something. :o/

[*] Not sure if it always imply a transition to D3 though.

> Perhaps call check_link_status at the end if init_one instead to
> activate pm then ?

It should not be needed, see above.

Moreover one should not care for the link status until the device is
brought up. It may seem a bit counterintuitive but the device and its
PHY are tightly coupled here. You do not manage them separately.

You should forget it anyway: PHY init happens late in the r8169 driver
and it can not be done sooner as it sometimes depends on firmware loading.

-- 
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists