public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Questions about Runtime Power Management
@ 2013-06-09 16:28 Morales, Alejandra
  2013-06-10  8:39 ` Oliver Neukum
  2013-06-16 15:07 ` Ming Lei
  0 siblings, 2 replies; 6+ messages in thread
From: Morales, Alejandra @ 2013-06-09 16:28 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org

Dear all,

I am currently involved in the implementation of my master thesis, for what I am trying to create a user space power management tool. As a part of this work I am developing a kernel module, and one of the first things I need to do is getting the current power state of some devices of my computer, essentially hard drives and network devices (ethernet and wireless cards).

For the hard drives, I get the pointers to the struct device that represents each one iterating over scsi_bus_type and selecting those whose driver is named "sd". Then, I obtain the runtime power state:

dev->power.runtime_status;

I did a test with an external USB hard drive, checking the runtime power state before and after issuing a sleep command with hdparm -Y. The drive effectively spinned down, but the runtime power state didn't change from active to suspended.

In the case of net devices, I get the corresponding structures this way:

struct net_device *netdev = first_net_device(&init_net);
    
while (netdev) {

        struct device *dev = &netdev->dev;
        
        /* code... */

        netdev = next_net_device(netdev);
}

For every net_device I get its embedded struct device and then I check the same field as before, but in this case runtime power management is disabled, so I always get the device is suspended, even though it is configured and working properly. In fact, the whole device struct seems to be empty.  

Taking this into account, my questions are:

- Is it possible that I am not getting the correct struct device for every hardware device?
- Am I checking the correct field of the struct dev_pm_info?
- Do scsi device drivers implement the runtime_status updates when drives effectively change their state?
- Is runtime power management supported by net devices?

Any answer would be really appreciated. Thanks in advance.

Best regards,

Alejandra Morales Ruiz
Master Thesis Student
Technische Universität München
Fakultät für Informatik

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-16 22:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-09 16:28 Questions about Runtime Power Management Morales, Alejandra
2013-06-10  8:39 ` Oliver Neukum
2013-06-11  7:53   ` Morales, Alejandra
2013-06-11  8:21     ` Oliver Neukum
2013-06-16 15:07 ` Ming Lei
2013-06-16 22:15   ` Oliver Neukum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox