Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5267451ybi; Tue, 4 Jun 2019 04:08:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNfRezBjulsrHYjI4JeU5xwK+zBky9n0ed13OrgkE2wX6BNKRipqxeorUSnRhMY0Ef0YUp X-Received: by 2002:a63:d816:: with SMTP id b22mr33766649pgh.16.1559646512692; Tue, 04 Jun 2019 04:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559646512; cv=none; d=google.com; s=arc-20160816; b=w1fCCK4ZQc0j5GdH9+xogP5l/BgLWuu0HL+23jKhlGU1jS3g6a4s4Z4yztpfAcZ18E b3WCGR6xB9x1Ch+3Zn7Dz8dHVY9tVV4Z2oGv0/78CYNTr/Xe3bSTAr7/KT4BOYTZ+SpS tqanC1JqtrvBB2YB/GryeJ6vRqvtQla9bHlSDqCs3bD7EYu2eWsRWmhU1N0zmL2Aug8Y eHGgnyY9SpJOM0jRdLyFq443Y+PBzBMfjQ8GvNW9QXGyVRQ3R4A/1FWL2LgomXKaLh5e t5Xl1yZebQxQRryRXkaYgdhH0zukVenbe+95i/evR50UbkHGTvzEToTsh863XPIxK6GC hUxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=yIFj0ID1tW081coDIUebMXc95bGRe+6pAmQ3bU7L15o=; b=OscR6W2qk31Xx+kQ5j+w+osj5IdHKLw1x9BY5e2KdDubjOwWGvqA+JOuFdBOc2Vxwb PguFtbhhALIt7dVgw1fPEAIj3ocht81rrb3cAu0blrQNu4JpTn7n63oJyIuiLij5aWxJ j1o4Lk42OqprMJaxMeDPlG9Dhpq5FcZTbiJGbTO66eVFVL8feNkHt/QuzVU8j6PyHECh SHd+bKvJ+tu7kEyX3vPHrKTvP1m2ED4qTrDWktyQvv2du4Spp6QWPLilF5FXNZz71PcT mX4xOohH47X4iKWNroaua19g7QMj3uAiHGLVS0GAgChkYyKyLtyXB8CG6diK1dupigGG wy0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YAl9EMAw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m62si22067340pgm.392.2019.06.04.04.08.14; Tue, 04 Jun 2019 04:08:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YAl9EMAw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727561AbfFDLFy (ORCPT + 99 others); Tue, 4 Jun 2019 07:05:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:60672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727242AbfFDLFx (ORCPT ); Tue, 4 Jun 2019 07:05:53 -0400 Received: from localhost.localdomain (unknown [223.93.147.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B6B6247B8; Tue, 4 Jun 2019 11:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559646353; bh=4wJAWudpE4ep1kaTxjl+dxZpkZ4VQfAFbKRM2WEW4lM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YAl9EMAwwyUVIHqJWJ7OHDn8K9OFo2h/zvw4sA7k88rdbqeeTCWcxy6QetVZ4EktZ ggIPRNiohKx1c58/NYvuQceTilDUO8mKCbIlz2ZkJ8KnvvSF6bMmdyKuCttB0S98Yg eqRclJoFYTli2AYxSgreLc6fP1UFBIhgiz90MVmY= From: guoren@kernel.org To: marc.zyngier@arm.com, mark.rutland@arm.com, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, jason@lakedaemon.net, guoren@kernel.org, linux-csky@vger.kernel.org, Guo Ren Subject: [PATCH V4 3/4] irqchip/irq-csky-mpintc: Support auto irq deliver to all cpus Date: Tue, 4 Jun 2019 19:05:05 +0800 Message-Id: <1559646306-18860-4-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559646306-18860-1-git-send-email-guoren@kernel.org> References: <1559646306-18860-1-git-send-email-guoren@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren The csky,mpintc could deliver a external irq to one cpu or all cpus, but it couldn't deliver a external irq to a group of cpus with cpu_mask. So we only use auto deliver mode when affinity mask_val is equal to cpu_present_mask. There is no limitation for only two cpus in SMP system. Signed-off-by: Guo Ren Cc: Marc Zyngier --- drivers/irqchip/irq-csky-mpintc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-csky-mpintc.c b/drivers/irqchip/irq-csky-mpintc.c index a451a07..2740dd5 100644 --- a/drivers/irqchip/irq-csky-mpintc.c +++ b/drivers/irqchip/irq-csky-mpintc.c @@ -143,8 +143,19 @@ static int csky_irq_set_affinity(struct irq_data *d, if (cpu >= nr_cpu_ids) return -EINVAL; - /* Enable interrupt destination */ - cpu |= BIT(31); + /* + * The csky,mpintc could support auto irq deliver, but it only + * could deliver external irq to one cpu or all cpus. So it + * doesn't support deliver external irq to a group of cpus + * with cpu_mask. + * SO we only use auto deliver mode when affinity mask_val is + * equal to cpu_present_mask. + * + */ + if (cpumask_equal(mask_val, cpu_present_mask)) + cpu = 0; + else + cpu |= BIT(31); writel_relaxed(cpu, INTCG_base + INTCG_CIDSTR + offset); -- 2.7.4