linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] ARM: ux500: move PRCMU functions into the CPUidle driver
Date: Mon, 25 Mar 2013 15:36:46 +0100	[thread overview]
Message-ID: <CACRpkda=FT1cHA=2oZkNcxxB=NvGLbuKia=hHkxSzEBu07CL8g@mail.gmail.com> (raw)
In-Reply-To: <201303251411.43356.arnd@arndb.de>

On Mon, Mar 25, 2013 at 3:11 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 25 March 2013, Linus Walleij wrote:
>> On Mon, Mar 25, 2013 at 2:58 PM, Daniel Lezcano
>> <daniel.lezcano@linaro.org> wrote:
>> > On 03/25/2013 02:44 PM, Linus Walleij wrote:
>>
>> >> Shall I put it in <linux/platform_data/arm-ux500-pm.h> or so,
>> >> with the implementation in arch/arm/mach-ux500/pm.c
>> >> or so?
>> >
>> > Wouldn't <asm/pm.h> be better ? So we can have the same header name for
>> > all the drivers, no ?
>>
>> I don't think that works with multiplatform. When building multiple
>> systems our approach is to not let any two header files have the same
>> name.
>>
>> What we did for debug macro for example was to create the <debug/*>
>> namespace, so the old <mach/debug-macro.S> is now <debug/imx.S>,
>> <debug/vt8500.h>, <debug/ux500.h> ... etc.
>>
>> So what would be needed would then rather be <pm/*> in
>> arch/arm/include/pm and under this we would create
>> <pm/ux500.h>.
>>
>> But that require Russell and Arnds/Olofs consent I think,
>> what do you guys say? Other recommendations?
>
> I would first like to understand what contents you actually need to
> have in the header file.

So in this case headers for the PRCMU+GIC code moving out
of the PRCMU driver. These are the functions and the comments
right above them:

/* This function decouple the gic from the prcmu */
prcmu_gic_decouple()

/* This function recouple the gic with the prcmu */
prcmu_gic_recouple()

/*
 * This function checks if there are pending irq on the gic. It only
 * makes sense if the gic has been decoupled before with the
 * db8500_prcmu_gic_decouple function. Disabling an interrupt only
 * disables the forwarding of the interrupt to any CPU interface. It
 * does not prevent the interrupt from changing state, for example
 * becoming pending, or active and pending if it is already
 * active. Hence, we have to check the interrupt is pending *and* is
 * active.
 */
prcmu_gic_pending_irq()

/*
 * This function checks if there are pending interrupt on the
 * prcmu which has been delegated to monitor the irqs with the
 * db8500_prcmu_copy_gic_settings function.
 */
bool prcmu_pending_irq()

/*
 * This function checks if the specified cpu is in in WFI. It's usage
 * makes sense only if the gic is decoupled with the db8500_prcmu_gic_decouple
 * function. Of course passing smp_processor_id() to this function will
 * always return false...
 */
bool prcmu_is_cpu_in_wfi()

/*
 * This function copies the gic SPI settings to the prcmu in order to
 * monitor them and abort/finish the retention/off sequence or state.
 */
int prcmu_copy_gic_settings()

This set of functions are called both for idling and suspend, i.e.
both by the machine-specific cpuidle driver and the machine-specific
suspend code.

They are conceptually coherent functions but messing with both PRCMU
and GIC registers, moving the responsibility of keeping track of the
IRQs back and forth between the GIC and the PRCMU.

Being able to freeze and decouple the GIC and check if a CPU is
in WFI is a ux500-PRCMU-specific pecularity but saves us a lot of
criss-cross IPIs when going to idle or sleep.

Yours,
Linus Walleij

  reply	other threads:[~2013-03-25 14:36 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 11:49 [PATCH 0/6] ARM: ux500: first multiplatform series Linus Walleij
2013-03-21 11:49 ` [PATCH 1/6] ARM: ux500: move debugmacro to debug includes Linus Walleij
2013-03-21 12:06   ` Arnd Bergmann
2013-03-21 11:49 ` [PATCH 2/6] clk: ux500: pass clock base adresses in init call Linus Walleij
2013-03-21 12:10   ` Arnd Bergmann
2013-03-21 14:05   ` Ulf Hansson
2013-03-21 17:50   ` Mike Turquette
2013-03-21 11:49 ` [PATCH 3/6] mfd: prcmu: pass a base and size with the early initcall Linus Walleij
2013-03-21 12:11   ` Arnd Bergmann
2013-03-21 14:01     ` Ulf Hansson
2013-03-21 11:49 ` [PATCH 4/6] mfd: db8500-prcmu: get base address from resource Linus Walleij
2013-03-21 12:15   ` Arnd Bergmann
2013-03-21 17:10     ` Linus Walleij
2013-03-21 19:07       ` Arnd Bergmann
2013-03-21 20:26         ` Loic PALLARDY
2013-03-21 11:49 ` [PATCH 5/6] ARM: ux500: move PRCMU functions into the CPUidle driver Linus Walleij
2013-03-21 12:14   ` Rickard Andersson
2013-03-21 12:30     ` Daniel Lezcano
2013-03-22  8:30       ` Rickard Andersson
2013-03-25 13:44       ` Linus Walleij
2013-03-25 13:58         ` Daniel Lezcano
2013-03-25 14:10           ` Linus Walleij
2013-03-25 14:11             ` Arnd Bergmann
2013-03-25 14:36               ` Linus Walleij [this message]
2013-03-25 15:13                 ` Arnd Bergmann
2013-03-25 15:48                   ` Linus Walleij
2013-03-21 11:49 ` [PATCH 6/6] ARM: ux500: get rid of <mach/[hardware|db8500-regs].h> Linus Walleij
2013-03-21 12:21   ` Arnd Bergmann
2013-03-21 21:51 ` [PATCH 0/9] More ux500 multiplatform stuff Arnd Bergmann
2013-03-21 21:51   ` [PATCH 1/9] ARM: ux500: move mach/msp.h to include/linux/platform_data.h Arnd Bergmann
2013-03-21 21:51   ` [PATCH 2/9] ARM: ux500: split out prcmu initialization Arnd Bergmann
2013-03-21 21:51   ` [PATCH 3/9] ARM: ux500: make irqs.h local to platform Arnd Bergmann
2013-03-21 21:51   ` [PATCH 4/9] ARM: ux500: kill mach/hardware.h some more Arnd Bergmann
2013-03-21 21:51   ` [PATCH 5/9] staging: ste_rmi4: kill platform_data hack Arnd Bergmann
2013-03-25 13:12     ` Linus Walleij
2013-03-25 18:00       ` Greg KH
2013-03-21 21:51   ` [PATCH 6/9] power: pm2301_charger: remove __devinit annotations Arnd Bergmann
2013-03-22 12:14     ` Linus Walleij
2013-03-22 15:16       ` Anton Vorontsov
2013-03-25  3:09       ` Anton Vorontsov
2013-03-21 21:51   ` [PATCH 7/9] ARM: ux500: make remaining headers local Arnd Bergmann
2013-03-21 21:51   ` [PATCH 8/9] ARM: ux500: move to multiplatform Arnd Bergmann
2013-03-21 21:51   ` [PATCH 9/9] ARM: ux500: build hotplug.o for ARMv7-a Arnd Bergmann
2013-03-22 13:21   ` [PATCH 0/9] More ux500 multiplatform stuff Linus Walleij
2013-03-22 13:34     ` Arnd Bergmann
2013-03-22 13:36       ` Linus Walleij
2013-03-22 14:16         ` Arnd Bergmann
2013-03-22 14:39       ` Linus Walleij
2013-03-22 15:25         ` Arnd Bergmann

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='CACRpkda=FT1cHA=2oZkNcxxB=NvGLbuKia=hHkxSzEBu07CL8g@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).