From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752129AbdHHJo7 (ORCPT ); Tue, 8 Aug 2017 05:44:59 -0400 Received: from foss.arm.com ([217.140.101.70]:59010 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbdHHJo6 (ORCPT ); Tue, 8 Aug 2017 05:44:58 -0400 Subject: Re: [PATCH RFC] irqchip: gic-v3: Support forced cpu irq affinity setting To: Alim Akhtar , tglx@linutronix.de, linux-kernel@vger.kernel.org References: <1502183093-30327-1-git-send-email-alim.akhtar@samsung.com> <7ea6b8d3-762a-d4e9-3b64-609b534c3960@arm.com> Cc: jason@lakedaemon.net, linux-arm-kernel@lists.infradead.org, shaik.ameer@samsung.com, aswani.reddy@samsung.com, abhinav.k@samsung.com, alim.akhtar@gmail.com, arjun.kv@samsung.com From: Marc Zyngier Organization: ARM Ltd Message-ID: Date: Tue, 8 Aug 2017 10:44:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/08/17 10:27, Alim Akhtar wrote: > > > On 08/08/2017 02:52 PM, Marc Zyngier wrote: >> On 08/08/17 10:04, Alim Akhtar wrote: >>> Skip check for online cpu mask when setting irq affinity of per cpu timer >>> during early startup of not yet online cpu. >>> >>> Signed-off-by: Shaik Ameer Basha >>> Signed-off-by: Aswani Reddy >>> Signed-off-by: Alim Akhtar >>> --- >>> drivers/irqchip/irq-gic-v3.c | 7 ++++++- >>> 1 file changed, 6 insertions(+), 1 deletion(-) >>> >>> Currently when non boot CPUs comes up and if setting of IRQ affinity gets called >>> before cpu online status gets updated, gic_mpidr_to_affinity() returns >>> undesirable cpu number. Using __force__ flag ignore cpu_online_mask and setup >>> the intended cpu affinity for the irq. >>> >>> The same approch is used in gicv2 >>> (commit: ffde1de64012c: irqchip: Gic: Support forced affinity setting) >>> >>> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c >>> index dbffb7a..c238c64 100644 >>> --- a/drivers/irqchip/irq-gic-v3.c >>> +++ b/drivers/irqchip/irq-gic-v3.c >>> @@ -640,11 +640,16 @@ static void gic_smp_init(void) >>> static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, >>> bool force) >>> { >>> - unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask); >>> + unsigned int cpu; >>> void __iomem *reg; >>> int enabled; >>> u64 val; >>> >>> + if (!force) >>> + cpu = cpumask_any_and(mask_val, cpu_online_mask); >>> + else >>> + cpu = cpumask_first(mask_val); >>> + >>> if (cpu >= nr_cpu_ids) >>> return -EINVAL; >>> >>> >> >> See >> >> https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=irq/irqchip-4.13&id=65a30f8b300107266f316d550f060ccc186201a3 >> > > Thanks Marc for above link. Is this already queued in some tree? I can't > find this is linux-next. It is queued as a fix for 4.13, bug tglx is offline for the time being, so this has not hit -next yet. Thanks, M. -- Jazz is not dead. It just smells funny...