From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@ozlabs.org,
Johannes Berg <johannes@sipsolutions.net>,
Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] power-management elements for 603e/fsl (version 2)
Date: Mon, 21 May 2007 22:50:20 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.60.0705212225470.7562@poirot.grange> (raw)
In-Reply-To: <20070521155712.GA16235@ld0162-tx32.am.freescale.net>
On Mon, 21 May 2007, Scott Wood wrote:
> On Sat, May 19, 2007 at 09:22:10PM +0200, Guennadi Liakhovetski wrote:
> > + local_irq_disable();
>
> IRQs are already disabled when this function is called.
ok
> > + /* go zzzzz... (re-enabling interrupts) */
> > + fsl_low_sleep();
>
> IRQs really shouldn't be enabled here without something like the "Handle
> HID0_SLEEP in the TLF_NAPPING hack" patch I posted recently.
Ok, I'd be happy to rely on those your patches... as long as they make it
into the kernel. Paulus, what's the plan? I'll try to apply them locally
for now and adjust my code accordingly. A recent powerpc.git should be
fine, I guess - the arch_suspend_{disable,enable}_irqs hooks are already
there, or are there any further dependencies?
> > + /* Re-enable local CPU interrupts */
> > + local_irq_enable();
>
> Just leave them off.
ok
> > @@ -112,10 +155,15 @@ static int __init ls_uarts_init(void)
> >
> > avr_clock = *(u32*)of_get_property(avr, "clock-frequency", &len);
> > phys_addr = ((u32*)of_get_property(avr, "reg", &len))[0];
> > + irq = ((u32*)get_property(avr, "interrupts", &len))[0];
>
> Oopsing if a property is missing isn't nice.
Hm, it is in .dts in the kernel tree, do I still have to care a possible
non-compliant version? Probably, you're right, will fix.
> > + local_irq_save(flags);
> > + /* Apparently, MacOS uses NAP mode for Grackle ??? */
> > + pmcr1 &= ~(MPC10X_DOZE | MPC10X_NAP);
> > + pmcr1 |= MPC10X_PM | MPC10X_SLEEP | MPC10X_LP_REF_EN;
> > + pci_write_config_word(bridge, 0x70, pmcr1);
> > + local_irq_restore(flags);
>
> This should probably be something like mpc10x_suspend. Also, IRQs should
> already be disabled when this is called.
well, I'd also prefer a more specific namespace than "fsl." Would it be ok
to call them with mpc10x (has been discussed on irc, I remember there have
been objections against this as mpc10x are just some host-pci bridges from
older Apple (not only?) machines)? And if we use mpc10x, is it ok to leave
them in fsl_soc.c?
> > + /* Make sure the decrementer won't interrupt us */
> > + asm volatile("mtdec %0" : : "r" (0x7fffffff));
> > + /* Make sure any pending DEC interrupt occurring while we did
> > + * the above didn't re-enable the DEC */
> > + mb();
> > + asm volatile("mtdec %0" : : "r" (0x7fffffff)); /* 8 seconds */
>
> IRQs are already disabled here, so if it was pending it still will be (at
> least with some cores). It needs to be done with the arch suspend hook.
as above, will test with your patches.
Thanks for comments!
Guennadi
---
Guennadi Liakhovetski
next prev parent reply other threads:[~2007-05-21 20:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-19 19:22 [PATCH] power-management elements for 603e/fsl (version 2) Guennadi Liakhovetski
2007-05-21 15:54 ` Johannes Berg
2007-05-21 15:57 ` Scott Wood
2007-05-21 20:50 ` Guennadi Liakhovetski [this message]
2007-07-01 21:19 ` Guennadi Liakhovetski
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=Pine.LNX.4.60.0705212225470.7562@poirot.grange \
--to=g.liakhovetski@gmx.de \
--cc=johannes@sipsolutions.net \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=scottwood@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox