All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rajendra Nayak" <rnayak@ti.com>
To: "'Dasgupta, Romit'" <romit@ti.com>, linux-omap@vger.kernel.org
Subject: RE: [PATCH 01/04] OMAP3 SRF: Generic shared resource f/w
Date: Fri, 17 Oct 2008 13:13:59 +0530	[thread overview]
Message-ID: <02bd01c9302c$1e630570$LocalHost@wipultra1382> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB59301B038E9DC@dbde02.ent.ti.com>

> -----Original Message-----
> From: Dasgupta, Romit [mailto:romit@ti.com] 
> Sent: Friday, October 17, 2008 1:06 PM
> To: Nayak, Rajendra; linux-omap@vger.kernel.org
> Subject: RE: [PATCH 01/04] OMAP3 SRF: Generic shared resource f/w
> 
> >> 1) curr_level of the shared_resource is not updated in
> >> update_resource_level
> >
> >Yes, its not. Its done as part of the platform specific 
> change_level call.
> 
> [Romit] Kindly see below. I was thinking that it is better 
> that we do not access any fields of struct shared_resource 
> from outside this file. Would the line below solve the problem?

The actual *target_level* of the resource will depend on the resource type.
Hence for say a "per_pwrdm_latency" resource if some user request's for a 
latency of no more than 130ms, it inturn translates to a PWRDM_RET level
depending on the specific latency to go to RET/OFF.

So what is currently done is the current_level of the resource in the above case 
is set to PWRDM_RET and if done the way you are suggesting will be set to 130ms.
 
> 
> >> >+static int update_resource_level(struct shared_resource *resp)
> >> >+{
> >> >+      struct users_list *user;
> >> >+      unsigned long target_level;
> >> >+      int ret;
> >> >+
> >> >+      /* Regenerate the target_value for the resource */
> >> >+      target_level = RES_DEFAULTLEVEL;
> >> >+      list_for_each_entry(user, &resp->users_list, node)
> >> >+              if (user->level > target_level)
> >> >+                      target_level = user->level;
> >> >+
> >> >+      pr_debug("SRF: Changing Level for resource %s to %ld\n",
> >> >+                              resp->name, target_level);
> >> >+      ret = resp->ops->change_level(resp, target_level);
> >> >+      if (ret) {
> >> >+              printk(KERN_ERR "Unable to Change"
> >> >+                                      "level for resource
> >> %s to %ld\n",
> >> >+              resp->name, target_level);
> >> >+      } else 
> 	          resp->curr_level = target_level; /* [Romit]  
> Should be done here.*/
> >> >+      return ret;
> >> >+}
> >
> >> 2) resource_request invokes spin_lock_irqsave and then if it
> >> is a request for a new device it invokes get_user().
> >> get_user() calls kmalloc with GFP_KERNEL. So it can sleep.
> >> Hence you will sleep with spinlocks held!!
> >
> >Right, so I'll probably have to add a GFP_ATOMIC flag to that.
> >I am now thinking If I really need spinlocks, think I can do 
> with mutex's instead.
> >The spinlocks were put in place to take care of the omap-pm 
> hooks from
> >clock f/w which no longer seem to be needed.
> [Romit] Trying to review the rest of the patches in the 
> patchset to get a better picture.
> 
> 


  reply	other threads:[~2008-10-17  7:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-16 14:11 [PATCH 01/04] OMAP3 SRF: Generic shared resource f/w Rajendra Nayak
2008-10-16 18:27 ` David Brownell
2008-10-17  5:27   ` Rajendra Nayak
2008-10-17  6:16 ` Dasgupta, Romit
2008-10-17  6:29   ` Rajendra Nayak
2008-10-17  7:35     ` Dasgupta, Romit
2008-10-17  7:43       ` Rajendra Nayak [this message]
2008-10-17 11:01         ` Dasgupta, Romit
2008-10-17 11:31           ` Dasgupta, Romit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='02bd01c9302c$1e630570$LocalHost@wipultra1382' \
    --to=rnayak@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=romit@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.