答复: [RFC PATCH] powerpc/fsl: add timer wakeup source

Wang Dongsheng-B40534 B40534 at freescale.com
Wed Oct 10 00:56:53 EST 2012


> > > > I'm pretty sure /proc/ is NOT where we want this exposed.
> > >
> > > Should probably go under the sysfs directory of the mpic device.  Or
> > > better, make a generic interface for timer-based suspend wakeup (if
> > there
> > > isn't one already).  This current approach sits in an unpleasant
> middle
> > > ground between generic and device-specific.
> > >
> > /sys/power/wakeup_timer_seconds how about this?
> > I think it is a freescale generic interface, this interface control by
> > FSL_SOC && SUSPEND.

> There's no such thing as a "Freescale generic interface".  Linux APIs
> are not organized by hardware vendor.  Either make a truly generic
> interface, reuse an existing one, or do something that is attached to
> the specific driver.
Thanks, I think i can change mpic timer registration, i will use platform_driver_register.
I will merge "mpic timer" and "timer wakeup". In "mpic timer" the wakeup function
controls by SUSPEND. The sys path is "/sys/devices/soc8572.4/ffe41100.timer/wakeup_seconds".
do you have any suggestions for this? or have a better idea about the sys path?

> > > Use depends rather than if/else.  Why do you need FSL_WAKEUP_SOURCE?
> > >
> > It lists all wake up source. If later have wakeup source can be
> > improved by
> > it to control. Buttons event wakeup source will be added after the
> > timer.

> It does not list all wake up sources -- there's also ethernet, USB, etc.
fine, change to depends. thanks.

> > >
> > > If the new time is zero, consider that a cancellation of the timer
> > and
> > > don't request a new one or return -EINVAL.
> > >
> > Thanks, I think i should add comments. Let this patch easy to read.
> > Here is get a new timer.
> > If the new time is zero, consider that has been checked.
> >
> > if (!time.tv_sec) {...} this is check zero.
> > The "mpic_request_timer" before this code.

> Ah, I see.  Wouldn't it be simpler to remove that block and just test
> time.tv_sec when requesting the new timer?
Yes, wake up function only need seconds level, and it's just hold a timer.
echo zero to cancel, and echo a new time to update the timer time.


More information about the Linuxppc-dev mailing list