On Wed, 24 Feb 2021 01:45:40 +0000 Joakim Zhang wrote: > > I'm not an expert on this stuff, but is there a reason you're not > > integrating this > > functionality with the power management subsystem? > > Do you mean that implement runtime power management for driver? If > yes, I think that is another feature, we can support later.
Runtime is a strong word, IIUC you can just implement the PM callbacks, and always resume in .open and always suspend in .close. Pretty much what you have already. > > I don't think it'd change the functionality, but it'd feel more idiomatic > > to fit in > > the standard Linux framework. > > Yes, there is no functionality change, this patch set just adds clocks > management. > In the driver now, we manage clocks at two point side: > 1. enable clocks when probe driver, disable clocks when remove driver. > 2. disable clocks when system suspend, enable clocks when system resume back. > > This should not be enough, such as, even we close the NIC, the clocks still > enabled. So this patch improve below: > Keep clocks disabled after driver probe, enable clocks when NIC up, and then > disable clocks when NIC down. > The aim is to enable clocks when it needs, others keep clocks disabled. Understood. Please double check ethtool callbacks work fine. People often forget about those when disabling clocks in .close.