lkml.org 
[lkml]   [2012]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Exynos : Add support for Exynos random number generator
On Tue, 26 Jun 2012, Stephen Boyd wrote:

> On 06/21/12 18:39, jonghwa3.lee@samsung.com wrote:
> > On 2012년 06월 21일 12:12, Stephen Boyd wrote:
> >
> >> On 06/20/12 19:39, jonghwa3.lee@samsung.com wrote:
> >>>>> +static int exynos_init(struct hwrng *rng)
> >>>>> +{
> >>>>> + struct exynos_rng *exynos_rng = container_of(rng,
> >>>>> + struct exynos_rng, rng);
> >>>>> + int i;
> >>>>> + int ret = 0;
> >>>>> + u32 PRND_SEED[5];
> >>>>> +
> >>>>> + pm_runtime_put_noidle(exynos_rng->dev);
> >>>>> + pm_runtime_get_sync(exynos_rng->dev);
> >>>> This looks very odd. Why are you calling pm_runtime_put_noidle()?
> >>>>
> >>> When this callback function is called, the status of power state is
> >>> 'suspended' and use_count is 1.

That's strange to begin with. If the usage counter is > 0 then the
device shouldn't be suspended. How does this happen?
> To perform pm_runtime_get_sync()
> >>> correctly, it requires to have 'suspended' status and use_count is 0.

That's not true. pm_runtime_get_sync works perfectly well when the
status is "suspended" and the usage counter is > 0.
> >>> Thus i force to decrease use_count only with using
> >>> pm_runtime_put_noidle. I know it looks odd, but i couldn't find better
> >>> way. Otherwise it can use clk_enable() directly, but i think that it
> >>> isn't good neither.
> >> Is the device suspended initially at probe? If so can you set the state
> >> of the device to suspended?
> >>
> >
> > Yes, it suspended already at the initial of probing. But i can't get
> > your point, you want to me to make device suspended?
>
> I mean to say you should probably call pm_runtime_set_suspended() during
> probe. But I'm not sure and I would defer to people more familiar with
> runtime pm.

If the device starts out in a suspended state then the subsystem or
driver should call pm_runtime_set_suspended before calling
pm_runtime_enable.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-06-27 16:41    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site