Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1392144pxu; Fri, 27 Nov 2020 06:19:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLM+6fHYKPjFkHapdFu++q5Xl3m3PYXme7tN0SjZY4R4WnbXzWa8VU3f/jJHiUAas9uP6/ X-Received: by 2002:a17:906:b74b:: with SMTP id fx11mr5702102ejb.410.1606486784101; Fri, 27 Nov 2020 06:19:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606486784; cv=none; d=google.com; s=arc-20160816; b=KVkkqZNCiBGGWF1+bA7o2vEXHVdTzprdvLp3U3ZcEHTFsbXpc7OivTc46yeW/cu5Iz m96JYO7MoBA48dnNxFTGY3DfLZFI1IrqQlWiDjl8eVYDFzXaot5k53SAA5cAIeSpqs/0 bC/ewe6YDptHGqHPUITU/uMSF437gKxbVHEIGDDsEsq9125zGKbdcfgObCsV2IaJKccI lxEJjj4lHBVL0pA6kWE/i4GzNL/LVr52TmMUVHqC4/iBgNRcztM0SEk04gj97mrdSKFc dIjnREzpjcNrUqTDX4kxV/DzUPzBxp2swYKRfF/xFtorhxT9kYMgfHUdZzgHCps0DHBE c90Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=IHQKxHbCP6EHGZBj6/JYw8VSRJN60lq3Y/yHYypdnrY=; b=JgqTvS2rQ9dJV21jQDgzpu7/3RUPIp9oTeSGVoxkDA6i/I9kmmcEbMX5Bs3AZjvcUh 9b69yMyfVrCLjVZVxzK0d/ckO7uJDdzCJht4+onT4zviufxn4Ek2O+bC+DNtb2IWgH17 IttHcA0pBDPm82K6N44Czo3IDkFMxW8kEuK0r4rKy9nsAxo1i0oiJpwEJQDSDp1xuFyv cm1w+MOi4d5CVGAUn6eeBYSj2XFk4mJN7m/ZVQPVZSa51YEIGQm74YplFG2TzzFW6/cm /5k1Q8QwRbTIn6JcRxGuuvu8aGUDiDxDHJECdpKz9+bRQPcp3HwWNSJTTlsZMQ4Hq3j5 +GNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si4487789ejy.455.2020.11.27.06.19.19; Fri, 27 Nov 2020 06:19:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730775AbgK0OPt (ORCPT + 99 others); Fri, 27 Nov 2020 09:15:49 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:44457 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730452AbgK0OPs (ORCPT ); Fri, 27 Nov 2020 09:15:48 -0500 X-UUID: 8978fd3abd0e426fabbd4ebd9e976a26-20201127 X-UUID: 8978fd3abd0e426fabbd4ebd9e976a26-20201127 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 259538449; Fri, 27 Nov 2020 22:15:41 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 27 Nov 2020 22:15:32 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 27 Nov 2020 22:15:32 +0800 From: Hanks Chen To: Thomas Gleixner , Jason Cooper , Marc Zyngier , Matthias Brugger , Russell King , Catalin Marinas , Will Deacon , Mark Rutland CC: , , , CC Hwang , Kuohong Wang , Loda Chou , Hanks Chen Subject: Support 1 of N SPI interrupt for interrupt distribution Date: Fri, 27 Nov 2020 22:15:28 +0800 Message-ID: <1606486531-25719-1-git-send-email-hanks.chen@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org *** BLURB HERE *** The GICv3 supports 1 of N selection of SPI interrupts. When the GICD_IROUTERn.Interrupt_Routing_Mode == 1, the GIC selects the appropriate core for a SPI. Actually, dispatch the interrupt by hardware Interrupt Control Unit is more efficient than irqbalance of software logic and no need to implement software contoller to decide the targeted CPU on various platform. In order to reduce interrupt latency, all interrupts are targeted to each online CPU defaultly by 1 of N selection of SPI interrupts. That is, SPI interrupts might be serviced simultaneously on different CPUs. [default policy] AS-IS (target to boot CPU) CPU0 CPU1 CPU2 CPU3 29: 92 0 0 0 GICv3 141 Level ttyS0 TO-BE (enable ARM_IRQ_TARGET_ALL) CPU0 CPU1 CPU2 CPU3 29: 23 23 24 22 GICv3 141 Level ttyS0 Hanks Chen (3): irqchip/gic: enable irq target all arm: disable irq on cpu shutdown flow arm64: disable irq on cpu shutdown flow arch/arm/kernel/smp.c | 10 ++- arch/arm64/kernel/smp.c | 9 ++- drivers/irqchip/Kconfig | 12 ++++ drivers/irqchip/irq-gic-v3.c | 107 +++++++++++++++++++++-------- include/linux/irqchip/arm-gic-v3.h | 1 + kernel/irq/cpuhotplug.c | 22 ++++++ kernel/irq/manage.c | 7 ++ 7 files changed, 138 insertions(+), 30 deletions(-) -- 2.18.0