From: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Marc Zyngier <marc.zyngier-5wv7dgnIgG8@public.gmane.org>
Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Ian Campbell
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
Thierry Reding
<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Kevin Hilman <khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Geert Uytterhoeven
<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>,
Grygorii Strashko
<grygorii.strashko-l0cyMroinI0@public.gmane.org>,
Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V4 7/9] irqchip/gic: Prepare for adding platform driver
Date: Mon, 6 Jun 2016 09:24:13 +0100 [thread overview]
Message-ID: <5755332D.5010506@nvidia.com> (raw)
In-Reply-To: <20160604110638.6aa47123-5wv7dgnIgG8@public.gmane.org>
On 04/06/16 11:06, Marc Zyngier wrote:
> On Thu, 12 May 2016 16:19:30 +0100
> Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>
>> To support GICs that require runtime power management, it is necessary
>> to add a platform driver, so that the probing of the chip can be
>> deferred if resources, such as a power-domain, is not yet available.
>>
>> To prepare for adding a platform driver:
>> 1. Drop the __init section from the gic_dist_config() so this can be
>> re-used by the platform driver.
>> 2. Add prototypes for functions required by the platform driver to a
>> local header file so they can be re-used.
>>
>> Signed-off-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> ---
>> drivers/irqchip/irq-gic-common.c | 4 ++--
>> drivers/irqchip/irq-gic.c | 18 ++++++++++--------
>> drivers/irqchip/irq-gic.h | 28 ++++++++++++++++++++++++++++
>> 3 files changed, 40 insertions(+), 10 deletions(-)
>> create mode 100644 drivers/irqchip/irq-gic.h
>>
>> diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c
>> index 97c0028e8388..c510cbd264b1 100644
>> --- a/drivers/irqchip/irq-gic-common.c
>> +++ b/drivers/irqchip/irq-gic-common.c
>> @@ -77,8 +77,8 @@ int gic_configure_irq(unsigned int irq, unsigned int type,
>> return ret;
>> }
>>
>> -void __init gic_dist_config(void __iomem *base, int gic_irqs,
>> - void (*sync_access)(void))
>> +void gic_dist_config(void __iomem *base, int gic_irqs,
>> + void (*sync_access)(void))
>> {
>> unsigned int i;
>>
>> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
>> index e043a19631b1..9f8ab124898b 100644
>> --- a/drivers/irqchip/irq-gic.c
>> +++ b/drivers/irqchip/irq-gic.c
>> @@ -48,6 +48,7 @@
>> #include <asm/smp_plat.h>
>> #include <asm/virt.h>
>>
>> +#include "irq-gic.h"
>> #include "irq-gic-common.h"
>>
>> #ifdef CONFIG_ARM64
>> @@ -363,7 +364,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
>> } while (1);
>> }
>>
>> -static void gic_handle_cascade_irq(struct irq_desc *desc)
>> +void gic_handle_cascade_irq(struct irq_desc *desc)
>> {
>> struct gic_chip_data *chip_data = irq_desc_get_handler_data(desc);
>> struct irq_chip *chip = irq_desc_get_chip(desc);
>> @@ -447,7 +448,7 @@ static void gic_cpu_if_up(struct gic_chip_data *gic)
>> }
>>
>>
>> -static void __init gic_dist_init(struct gic_chip_data *gic)
>> +static void gic_dist_init(struct gic_chip_data *gic)
>> {
>> unsigned int i;
>> u32 cpumask;
>> @@ -532,7 +533,7 @@ int gic_cpu_if_down(unsigned int gic_nr)
>> * this function, no interrupts will be delivered by the GIC, and another
>> * platform-specific wakeup source must be enabled.
>> */
>> -static void gic_dist_save(struct gic_chip_data *gic)
>> +void gic_dist_save(struct gic_chip_data *gic)
>> {
>> unsigned int gic_irqs;
>> void __iomem *dist_base;
>> @@ -571,7 +572,7 @@ static void gic_dist_save(struct gic_chip_data *gic)
>> * handled normally, but any edge interrupts that occured will not be seen by
>> * the GIC and need to be handled by the platform-specific wakeup source.
>> */
>> -static void gic_dist_restore(struct gic_chip_data *gic)
>> +void gic_dist_restore(struct gic_chip_data *gic)
>> {
>> unsigned int gic_irqs;
>> unsigned int i;
>> @@ -617,7 +618,7 @@ static void gic_dist_restore(struct gic_chip_data *gic)
>> writel_relaxed(GICD_ENABLE, dist_base + GIC_DIST_CTRL);
>> }
>>
>> -static void gic_cpu_save(struct gic_chip_data *gic)
>> +void gic_cpu_save(struct gic_chip_data *gic)
>> {
>> int i;
>> u32 *ptr;
>> @@ -647,7 +648,7 @@ static void gic_cpu_save(struct gic_chip_data *gic)
>>
>> }
>>
>> -static void gic_cpu_restore(struct gic_chip_data *gic)
>> +void gic_cpu_restore(struct gic_chip_data *gic)
>> {
>> int i;
>> u32 *ptr;
>> @@ -724,7 +725,7 @@ static struct notifier_block gic_notifier_block = {
>> .notifier_call = gic_notifier,
>> };
>>
>> -static int __init gic_pm_init(struct gic_chip_data *gic)
>> +static int gic_pm_init(struct gic_chip_data *gic)
>> {
>> gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4,
>> sizeof(u32));
>> @@ -754,7 +755,7 @@ free_ppi_enable:
>> return -ENOMEM;
>> }
>> #else
>> -static int __init gic_pm_init(struct gic_chip_data *gic)
>> +static int gic_pm_init(struct gic_chip_data *gic)
>> {
>> return 0;
>> }
>> @@ -1178,6 +1179,7 @@ static int __init __gic_init_bases(struct gic_chip_data *gic,
>> set_smp_cross_call(gic_raise_softirq);
>> register_cpu_notifier(&gic_cpu_notifier);
>> #endif
>> +
>> set_handle_irq(gic_handle_irq);
>> if (static_key_true(&supports_deactivate))
>> pr_info("GIC: Using split EOI/Deactivate mode\n");
>> diff --git a/drivers/irqchip/irq-gic.h b/drivers/irqchip/irq-gic.h
>> new file mode 100644
>> index 000000000000..646e92614b2c
>> --- /dev/null
>> +++ b/drivers/irqchip/irq-gic.h
>> @@ -0,0 +1,28 @@
>> +/*
>> + * Copyright (C) 2016 NVIDIA CORPORATION, All Rights Reserved.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program. If not, see <http://www.gnu.org/licenses/>.
>> + */
>> +
>> +#ifndef _IRQ_GIC_H
>> +#define _IRQ_GIC_H
>> +
>> +struct gic_chip_data;
>> +
>> +void gic_cpu_save(struct gic_chip_data *gic);
>> +void gic_cpu_restore(struct gic_chip_data *gic);
>> +void gic_dist_save(struct gic_chip_data *gic);
>> +void gic_dist_restore(struct gic_chip_data *gic);
>> +void gic_handle_cascade_irq(struct irq_desc *desc);
>> +
>> +#endif /* _IRQ_GIC_H */
>
> Any reason why all of this is not part of include/irqchip/arm-gic.h
> instead of creating yet another include file?
No not really, I can definitely move to that header and avoid adding
this one.
Cheers
Jon
--
nvpublic
next prev parent reply other threads:[~2016-06-06 8:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 15:19 [PATCH V4 0/9] Add support for Tegra210 AGIC Jon Hunter
2016-05-12 15:19 ` [PATCH V4 1/9] irqdomain: Fix handling of type settings for existing mappings Jon Hunter
2016-05-12 15:19 ` [PATCH V4 2/9] genirq: Look-up trigger type if not specified by caller Jon Hunter
2016-06-04 9:41 ` Marc Zyngier
2016-05-12 15:19 ` [PATCH V4 3/9] irqdomain: Don't set type when mapping an IRQ Jon Hunter
[not found] ` <1463066372-13115-4-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-06-04 9:51 ` Marc Zyngier
[not found] ` <1463066372-13115-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-05-12 15:19 ` [PATCH V4 4/9] genirq: Add runtime power management support for IRQ chips Jon Hunter
[not found] ` <1463066372-13115-5-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-06-04 9:53 ` Marc Zyngier
2016-05-12 15:19 ` [PATCH V4 5/9] irqchip/gic: Isolate early GIC initialisation code Jon Hunter
2016-05-12 15:19 ` [PATCH V4 8/9] dt-bindings: arm-gic: Add documentation for Tegra210 AGIC Jon Hunter
[not found] ` <1463066372-13115-9-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-05-16 16:05 ` Rob Herring
2016-05-20 9:07 ` [PATCH V4 0/9] Add support " Jon Hunter
2016-05-12 15:19 ` [PATCH V4 6/9] irqchip/gic: Add helper function for chip initialisation Jon Hunter
2016-05-12 15:19 ` [PATCH V4 7/9] irqchip/gic: Prepare for adding platform driver Jon Hunter
[not found] ` <1463066372-13115-8-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-06-04 10:06 ` Marc Zyngier
[not found] ` <20160604110638.6aa47123-5wv7dgnIgG8@public.gmane.org>
2016-06-06 8:24 ` Jon Hunter [this message]
2016-05-12 15:19 ` [PATCH V4 9/9] irqchip/gic: Add platform driver for non-root GICs that require RPM Jon Hunter
[not found] ` <1463066372-13115-10-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-06-04 10:10 ` Marc Zyngier
[not found] ` <20160604111020.38c7dd31-5wv7dgnIgG8@public.gmane.org>
2016-06-06 8:26 ` Jon Hunter
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=5755332D.5010506@nvidia.com \
--to=jonathanh-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
--cc=grygorii.strashko-l0cyMroinI0@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
--cc=khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marc.zyngier-5wv7dgnIgG8@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).