Samsung / TizenRT

TizenRT is a lightweight RTOS-based platform to support low-end IoT devices
Apache License 2.0
561 stars 560 forks source link

os/pm: Clean PM Code #6257

Open gSahitya-samsung opened 2 weeks ago

gSahitya-samsung commented 2 weeks ago

This commit adds registered domain_id checks in new PM APIs. With new domain registration API, we need to register TASH domain separately and use pm_suspend and pm_resume with tash's domain_id. It also corretcs typos and missing description in PM code.

Taejun-Kwon commented 2 weeks ago

Dear HQ,

  1. First of all, you should define PM interface include operations that is need to be implmented by Vendor easily. (up_set_dvfs can be one of operation)
    
    FAR struct inode *inode = filep->f_inode;
    FAR struct pm_dev_s dev = inode->i_private;
    int ret;

switch(cmd) { case PMIOC_TUNEFREQ: if (dev->pm_dvfs != NULL) { ret = dev->pm_dvfs(arg); } else { ret -ENOSYS; } break; ...


2. So you should define some dev structure include operations & value(include pm_domain_map) this is necessary to protect access to each of value without open driver.
3. In ioctl, you call set_errno, it should just return one of errno, set_errno will be called by fs_ioctl.

I think because of development schedule, this seems that hard to modified for now, but should be done in someday.
ewoodev commented 1 week ago

Dear HQ,

  1. First of all, you should define PM interface include operations that is need to be implmented by Vendor easily. (up_set_dvfs can be one of operation)
FAR struct inode *inode = filep->f_inode;
FAR struct pm_dev_s dev = inode->i_private;
int ret;

switch(cmd) {
case PMIOC_TUNEFREQ:
  if (dev->pm_dvfs != NULL) {
      ret = dev->pm_dvfs(arg);
  } else {
      ret -ENOSYS;
  }
  break;
...
  1. So you should define some dev structure include operations & value(include pm_domain_map) this is necessary to protect access to each of value without open driver.
  2. In ioctl, you call set_errno, it should just return one of errno, set_errno will be called by fs_ioctl.

I think because of development schedule, this seems that hard to modified for now, but should be done in someday.

Thank you for suggestion. For apply this, Let us dissus detail. Thank you