From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/7] ARM: EXYNOS4: Add support external GIC
Date: Mon, 10 Oct 2011 14:02:09 +0100 [thread overview]
Message-ID: <4E92ECD1.2010303@arm.com> (raw)
In-Reply-To: <20111007151646.GA2398@mudshark.cambridge.arm.com>
On 07/10/11 16:16, Will Deacon wrote:
> Hi Marc,
>
> On Fri, Oct 07, 2011 at 10:44:59AM +0100, Marc Zyngier wrote:
>> So to make my suggestion completely clear, here's a patch I'm now
>> carrying in my tree. It's only been test compiled on EXYNOS4, but works
>> nicely on my 11MP. It turns both dist_base and cpu_base into per-cpu
>> variables, removes these callbacks, removes your private copy of
>> gic_cpu_init, and makes struct gic_chip_data private again.
>>
>> What do you think?
>
> This looks like the right sort of idea, although I'm deeply suspicious about
> per-cpu base addresses for the GIC distributor. It would be nice if the
> Samsung guys can elaborate on what's going on here. Few comments inline.
Yeah, this seem odd, specially as what's currently in mainline doesn't
try to play tricks with the distributor. It looks like having a per-core
distributor address is required for PPI usage on these SoCs, but the
commit message is uninformative at best:
https://github.com/sfrothwell/linux-next/commit/637c2afa57ec9cd0ddc8879ea0cda4d8835ba71d#arch/arm/mach-exynos4/cpu.c
Again, comments from Samsung people would be much appreciated.
>> Subject: [PATCH] ARM: gic: allow GIC to support non-banked setups
>>
>> The GIC support code is heavily using the fact that hardware
>> implementations are exposing banked registers. Unfortunately, it
>> looks like at least one GIC implementation (EXYNOS4) offers both
>> the distributor and the CPU interfaces at different addresses,
>> depending on the CPU.
>>
>> This problem is solved by turning the distributor and CPU interface
>> addresses into per-cpu variables. The EXYNOS4 code is updated not
>> to mess with the GIC internals while handling interrupts, and
>> struct gic_chip_data is back to being private.
>>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>> arch/arm/common/gic.c | 76 +++++++++++++++++++++++++++--------
>> arch/arm/include/asm/hardware/gic.h | 17 +------
>> arch/arm/mach-exynos4/cpu.c | 14 ------
>> arch/arm/mach-exynos4/platsmp.c | 28 ++-----------
>> 4 files changed, 66 insertions(+), 69 deletions(-)
>>
>> diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
>> index b574931..c7521dd 100644
>> --- a/arch/arm/common/gic.c
>> +++ b/arch/arm/common/gic.c
>> @@ -37,6 +37,20 @@
>> #include <asm/mach/irq.h>
>> #include <asm/hardware/gic.h>
>>
>> +struct gic_chip_data {
>> + unsigned int irq_offset;
>> + void __percpu __iomem **dist_base;
>> + void __percpu __iomem **cpu_base;
>> +#ifdef CONFIG_CPU_PM
>> + u32 saved_spi_enable[DIV_ROUND_UP(1020, 32)];
>> + u32 saved_spi_conf[DIV_ROUND_UP(1020, 16)];
>> + u32 saved_spi_target[DIV_ROUND_UP(1020, 4)];
>> + u32 __percpu *saved_ppi_enable;
>> + u32 __percpu *saved_ppi_conf;
>> +#endif
>> + unsigned int gic_irqs;
>> +};
>
> I think you can use DECLARE_PER_CPU(void __iomem *dist_base) etc. instead.
Unfortunately, you can't. That would be nice though... ;-)
>> +static void __cpuinit exynos4_secondary_init(unsigned int cpu)
>> {
>> void __iomem *dist_base = S5P_VA_GIC_DIST +
>> - (gic_bank_offset * smp_processor_id());
>> + (gic_bank_offset * cpu_logical_map(cpu));
>
> Again, I'm deeply suspicious of this code :) Is there not a common memory
> alias for the distributor across all of the CPUs?
Kukjin, could you please comment on the presence of a common memory
region for the distributor? This seem quite odd...
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2011-10-10 13:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-20 7:34 [PATCH 0/7] ARM: EXYNOS4: Adds External GIC Changhwan Youn
2011-06-20 7:34 ` [PATCH 1/7] ARM: EXYNOS4: Add external GIC io memory mapping Changhwan Youn
2011-06-30 5:14 ` MyungJoo Ham
2011-06-30 6:54 ` MyungJoo Ham
2011-07-04 10:25 ` Kukjin Kim
2011-06-20 7:34 ` [PATCH 2/7] ARM: EXYNOS4: modify interrupt mappings for external GIC Changhwan Youn
2011-06-20 7:34 ` [PATCH 3/7] ARM: EXYNOS4: set the affinity of mct1 interrupt using IRQ_MCT_L1 Changhwan Youn
2011-06-20 7:34 ` [PATCH 4/7] ARM: GIC: move gic_chip_data structure declaration to header Changhwan Youn
2011-07-04 9:38 ` Kukjin Kim
2011-06-20 7:34 ` [PATCH 5/7] ARM: EXYNOS4: Add support external GIC Changhwan Youn
2011-10-05 13:55 ` Marc Zyngier
2011-10-06 6:30 ` Kukjin Kim
2011-10-06 8:18 ` Marc Zyngier
2011-10-07 9:44 ` Marc Zyngier
2011-10-07 10:54 ` Kukjin Kim
2011-10-07 15:16 ` Will Deacon
2011-10-10 13:02 ` Marc Zyngier [this message]
2011-10-11 12:22 ` Changhwan Youn
2011-10-11 13:30 ` Marc Zyngier
2011-10-12 5:16 ` Kukjin Kim
2011-11-02 11:15 ` Marc Zyngier
2011-11-02 11:29 ` Kukjin Kim
2011-10-13 11:09 ` Russell King - ARM Linux
2011-10-13 17:51 ` Will Deacon
2011-06-20 7:34 ` [PATCH 6/7] ARM: EXYNOS4: Remove clock event timers using ARM private timers Changhwan Youn
2011-06-20 7:34 ` [PATCH 7/7] ARM: EXYNOS4: Add chained enrty/exit function to uart interrupt handler Changhwan Youn
2011-06-21 0:01 ` [PATCH 0/7] ARM: EXYNOS4: Adds External GIC Kyungmin Park
2011-07-16 6:55 ` Kukjin Kim
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=4E92ECD1.2010303@arm.com \
--to=marc.zyngier@arm.com \
--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).