From nobody Sun Feb 8 14:35:21 2026 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B79371537BF; Sat, 31 Aug 2024 05:57:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725083832; cv=none; b=bUYRNiCLha7o6dXFt+2DfnDyKyub/fbEYxhBeuHAVQ7XFXw7RH2BmzYzGtZ+gFR3g/4lH1f7SeAUW0tt8H+OJOu6tJYRjtar+n2mSbs1eiD+O7+VOEtE3kjmJKs68YtozMpBPmBXJXxHEq44ZNOpuh3vNB6zOm4e7/C8wfgj0Nk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725083832; c=relaxed/simple; bh=5tgSRq5lvBi6wvc1wgAZq4DW7ZKyyVnTtG108xrA/dY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VJQqx1if6h8plKSPUxtBjGFNXkR40pyJ4MwU6tVkswaZ8VnOEJ3Kue4tk+Dgou1uGEuLwmACv9jEteKfA+uBNjCbMh3tQS5Agy3NA2aC+PX8sTjzXpkaU2q8Gs2TZANFWXUREnxfU4h+tk5KlVevjE/2WOyX9moHE5ybehPwNRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EGyA7+vf; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EGyA7+vf" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-202146e93f6so25179215ad.3; Fri, 30 Aug 2024 22:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725083830; x=1725688630; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+UZMOJ9tZhYVHk/YEPl6bWyPievm93YsDD+e3s9SDgs=; b=EGyA7+vfCsFJGPKEey3doF6ya+mM61CD/ECUZPt+uP0YtgOLPaNSwR5Y+Oxd05duNA Uo8pBUsH5QBoA6ZcuVwyHHGqBprJ/Nl14OHQVyvPG2z+Y1eLChAx0JipZsfmkOyPFDxk EKRAbknGchX7yYLgXkEHf86kz6U+DLHer++6e14luZ2vv5t+zgjmONDqDsNJEocfVy4u pfzXguYlzXHUXuDEJBzeICN5Sc3/tJZnw+74ikCi507khJVcCV6vyMY5cSCKLiKGmM6d JW/voZBTq1EEK0jnRGxT2DHezqa64I/1JCh3wvChRLJkbhFhmyILOLSG7sU2vo9FV0Ej mZ/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725083830; x=1725688630; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+UZMOJ9tZhYVHk/YEPl6bWyPievm93YsDD+e3s9SDgs=; b=w0aRJfrvhCQFL9ptZNW006YLe7pe0OKV/tc9r+zTPFmrL/RoYC7Z5PrXHaOLPlgpNt nZISxUTG5zxeaCbsM74vFRKcrdqPHMqT+UhCmFqPwgnM8KIIw1RlOZR5npr7r3Gu1cTu RR6y9+FrzMoQc7ZjAR4IlptR3NHa/0CWCuGtfJPEz3iX78H5Xa8BPUS4slzPr2gZOlgR 86xApwU/C+jk4Yw+lc1ch7mtPX58P0H2tN5BYvzs75sOO6/5FrLrHcTSzCKcPlirz/YP 60SjYS1++Kn8oiLsSSjlyKEgLBw+/Q4LqGKHvjDTdBLfDWu/W8HOEJWglo9JcpJemJwj HKrg== X-Forwarded-Encrypted: i=1; AJvYcCUMAu9uk0JJsFRp7oZprUkQo7KqSkZqfpNHFWtj9EMVq41cGveWcFQTxnNO3vo2E7L+nbUazuot8OiW@vger.kernel.org, AJvYcCVBpz5xslyyn4UaF7C4NLcY6G71q/Qiz4QQAg/gIDzt/RQdXTiU+KI9HMTEBdEXZY52pSaNiNiT14bqqmM9@vger.kernel.org X-Gm-Message-State: AOJu0Yw0OP9elNXvxlSjw2ObL0RtwDeX+0OPbnta4XfDIi7b9Np+dRsz HfWNZP5giuSh86Zecf0VXzZfp8bcs3jX4JRTxnLrA/YCrF3FK/IV X-Google-Smtp-Source: AGHT+IGgyopLwUfSPL49E8730EhvLqPDRmGJc0WWS5mZWfB25NqZV3DvqNch7iHLN016VoFzOLtscA== X-Received: by 2002:a17:903:41c7:b0:205:3832:ecc4 with SMTP id d9443c01a7336-2053832f198mr30229735ad.28.1725083829837; Fri, 30 Aug 2024 22:57:09 -0700 (PDT) Received: from localhost.localdomain ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2053aa8cb4asm12027045ad.271.2024.08.30.22.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 22:57:09 -0700 (PDT) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, konrad.dybcio@somainline.org Cc: ~postmarketos/upstreaming@lists.sr.ht, Nick Chan Subject: [PATCH v2 1/4] dt-bindings: apple,aic: Document A7-A11 compatibles Date: Sat, 31 Aug 2024 13:48:16 +0800 Message-ID: <20240831055605.3542-2-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240831055605.3542-1-towinchenmi@gmail.com> References: <20240831055605.3542-1-towinchenmi@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document and describe the compatibles for Apple A7-A11 SoCs. There are three feature levels: - apple,aic: No fast IPI, for A7-A10 - apple,t8015-aic: fast IPI, global only, for A11 - apple,t8103-aic: fast IPI with local and global support, for M1 Each feature level is an extension of the previous, for example, M1 will also work with the A7 feature level. All of A7-M1 gets its own SoC-specific compatible, and the "apple,aic" compatible as a fallback. Signed-off-by: Nick Chan Acked-by: Krzysztof Kozlowski Reviewed-by: Sven Peter --- .../bindings/interrupt-controller/apple,aic.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/apple,a= ic.yaml b/Documentation/devicetree/bindings/interrupt-controller/apple,aic.= yaml index 698588e9aa86..4be9b596a790 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/apple,aic.yaml @@ -31,13 +31,25 @@ description: | This device also represents the FIQ interrupt sources on platforms using= AIC, which do not go through a discrete interrupt controller. =20 + IPIs may be performed via MMIO registers on all variants of AIC. Starting + from A11, system registers may also be used for "fast" IPIs. Starting fr= om + M1, even faster IPIs within the same cluster may be achieved by writing = to + a "local" fast IPI register as opposed to using the "global" fast IPI + register. + allOf: - $ref: /schemas/interrupt-controller.yaml# =20 properties: compatible: items: - - const: apple,t8103-aic + - enum: + - apple,s5l8960x-aic + - apple,t7000-aic + - apple,s8000-aic + - apple,t8010-aic + - apple,t8015-aic + - apple,t8103-aic - const: apple,aic =20 interrupt-controller: true --=20 2.46.0 From nobody Sun Feb 8 14:35:21 2026 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E58511537BF; Sat, 31 Aug 2024 05:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725083837; cv=none; b=TjfG/DyOIHnuMyNyxzVrUdCmtMvRrlVppZdGPpb4oh0wj9JsN5t4USTWUPvYjypvaMPILs06wUdYYwMCt38E2ihE/7B+9I4mE+W3Ye5tF1p/vFoPWcgt7hZc/HtV0lukOf4w2umanc8xTO5/44veuly/o/GutRSiqQvAZ3sOOAc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725083837; c=relaxed/simple; bh=9su/Y9MlO6MXAM8Bt2sijpIlEdQJjfOz4vTGsWn3PGU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K9YoXOKmSKXEwRNk+haLZCRQwzVdEb0Dzf8wIQce9zFHNHZsGXbTGtzmqIjTbe8M3APXWALT3wdJ0S4txHa2HBn4CUPJJAPRomnLTvtQcPN4Aj84OmmATSYosGRaANh+tqirXaVDby4a6xf/C9c00LHsBnLQ0ObgBKAextN0riA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lizxhwrv; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lizxhwrv" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2053f6b8201so6749815ad.2; Fri, 30 Aug 2024 22:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725083835; x=1725688635; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D/aYPkj2NtDergsDX2rHe3JcKu2TUi+kPfkt+iApdo8=; b=lizxhwrvyx9UG7QH6eY9LZGFXYGfKuRnprzza2oeEAMJVhmy28gmrHUFWFk98vRJsg GK1J4mMVSBwq0GnwXbtBObjVM9aFM9MaqVDcg7+0wSNImdh64oWDBv88rIdSS97x8DYz Ob3XcDno4oiVos1XQIjtZmrKl1Rf9/QcYMwedsc1iao+qUAvcCQ57zNTh+etdCspo8Yx k86/+Bx8mtj4k6lpgIc3yHlbhyv8FpEA2EKGPuVhcHyOowf7fYSvv/PuVr0XakGioed7 Ifko70kvvIWvQ7OK+749bmSQK1bvpO2SQLPESSZOSSwXkJ/KlStGWzUs58n8qUAPtVpd JB9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725083835; x=1725688635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D/aYPkj2NtDergsDX2rHe3JcKu2TUi+kPfkt+iApdo8=; b=gpo97sFH4JjoFgVLSki8pVFumrSc59m9OxfYv4F6jhO9SPmK10KKjX167o1c+48Oxp tMIWmEteE6KMusZIB01ewLs1E85CQh7OPwW5oQKdP8pBa0zeNRRqc6NtmH0ym529Lj2T 6S05P8cgKBP1BY8XGwmJ2/lHGyUqPOAaqldLHYhAk/2tsffa/yf7Yc/+P3ZWYPtFUEop oZGl76fJ7XAElRL1nINMbkiCq2nM4fnbq6kjNvD44q7tMhnqRFflyEsfMp6EpfzsNLcc YYUuTSGW31oPY/xXjFjLZTn1F4GmFsVcunVd6TQrZC9BBC17ZB4Etal96hMjp21dPOFL nsRQ== X-Forwarded-Encrypted: i=1; AJvYcCWzMr4Bg3F2fbDNjQJijJg8SQ1iSaBy0FJ2Din9kyBr19zokHVQNdI7bKh3k+5nesGszLbzgOUXiXv6aUxS@vger.kernel.org, AJvYcCXMpOdJMPN43OjeZW5Qyyns3lcHKiqXVv5bVkVqOfpJXwpsg1AGM2o+w6TuHVCMEqmCvmhXWw2fTIe5@vger.kernel.org X-Gm-Message-State: AOJu0Yx24t8eHi3vHWa+h54dKaoBXoRHCvSkt8g8PEyKYa1i7yBXS9rB x9corLti3YgUaLAZzTtlQE1Mc+rZ5fv0Y23fYKkQnMSEMBMcv88x X-Google-Smtp-Source: AGHT+IGMvuTVKZ6LSJxB8CtCU4+d+sEou4o2/Fylk2vt34a2ffeFEJ4j/x7jh+K22k3uivREqt3WOA== X-Received: by 2002:a17:902:d545:b0:1fd:9e6e:7c1f with SMTP id d9443c01a7336-20546b553bdmr14689055ad.56.1725083835095; Fri, 30 Aug 2024 22:57:15 -0700 (PDT) Received: from localhost.localdomain ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2053aa8cb4asm12027045ad.271.2024.08.30.22.57.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 22:57:14 -0700 (PDT) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, konrad.dybcio@somainline.org Cc: ~postmarketos/upstreaming@lists.sr.ht, Nick Chan Subject: [PATCH v2 2/4] irqchip/apple-aic: Skip unnecessary setting of use_fast_ipi Date: Sat, 31 Aug 2024 13:48:17 +0800 Message-ID: <20240831055605.3542-3-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240831055605.3542-1-towinchenmi@gmail.com> References: <20240831055605.3542-1-towinchenmi@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" use_fast_ipi is true by default and there is no need to "enable" it. Signed-off-by: Nick Chan Acked-by: Sven Peter --- drivers/irqchip/irq-apple-aic.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-ai= c.c index 5c534d9fd2b0..8d81d5fb3c50 100644 --- a/drivers/irqchip/irq-apple-aic.c +++ b/drivers/irqchip/irq-apple-aic.c @@ -987,9 +987,7 @@ static int __init aic_of_ic_init(struct device_node *no= de, struct device_node *p off +=3D sizeof(u32) * (irqc->max_irq >> 5); /* MASK_CLR */ off +=3D sizeof(u32) * (irqc->max_irq >> 5); /* HW_STATE */ =20 - if (irqc->info.fast_ipi) - static_branch_enable(&use_fast_ipi); - else + if (!irqc->info.fast_ipi) static_branch_disable(&use_fast_ipi); =20 irqc->info.die_stride =3D off - start_off; --=20 2.46.0 From nobody Sun Feb 8 14:35:21 2026 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53E941531EA; Sat, 31 Aug 2024 05:57:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725083845; cv=none; b=DbcN3Vaatrs2xkkbVa2mIZUjdgqdr52l5yhDUYXK7WfzXDAC2uryncvkRNCVdxuxKug88JxULuleD0fZB+c6a0gjrKZp7cr28Glz1MNQqP/4gk8Vu8UNFHZobISB1OfwqHLbdmWWAYFMKOqyUH7AXluC8yWX7RjsEdurCaFqhNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725083845; c=relaxed/simple; bh=AiAs+f0DOwqb3mqumMEKWPoSTet5sVEF8qBpc+MVTOM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fKI73o6NoDKsoBOb5XLc5SiXtmNvIqL79y5IUdyaYK3vD2jUZysp8fNRG5Ejpd1auovyZ41YozYEw27myf6qwu7air9VbNbMhOuoI5yoN1FYTB8q7SmOeVHGsjVStzk/FyF7YEOdS42KQCo1LgyV3e4YXwe5aQ1JCnEiwzMHFpQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ADpS0UUS; arc=none smtp.client-ip=209.85.215.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ADpS0UUS" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-6c5bcb8e8edso1881773a12.2; Fri, 30 Aug 2024 22:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725083843; x=1725688643; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2wrsQB/6kr7Ma/wyHDMG36Gt57JsM43DlFH99Cporu0=; b=ADpS0UUS/80IIHYvyejBfiQ3mJMbZxSAt4PUttIzLitNugLB9EMu7TzoZcxuTdyY7A t71MXWWvobRhEYETaFE8MiIduwihef87Mlfk4ZbWN345aHnPX8E3zR9ekEnpEHgFBbCX dD1JuPvtA3CqtNgFnVZD1aieipQv6hjCu3+IbWWYPzNWpHVl9B4R+rVzbcX6KwuY33wW ELUKc2pROGZwsWAm6xALqfJ6SoD5aS1PuKP8sljh62gSkWUqLe8j1CtKY6YGA3WNWv+G sKuggGA7vx+MYGA4xXGLT6xgigM7NBZr4/ijXuuNXQGZbAToQYUWu670v9R/W39BdvXj YYUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725083843; x=1725688643; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2wrsQB/6kr7Ma/wyHDMG36Gt57JsM43DlFH99Cporu0=; b=HwXG5YAkdQ4WLnPaTEYqpNSfzSRL38pshzqI38qBW0RXYlK3+onCTp7a9uh43tbTTy ItapBht9yuBPntZkOVTRpyiI8tgMxJmRLgUlJ+4Tenom6mvuV43qG92hZWH0vd7CN50Y xWNQGn5Z6KZKoDFnSVnKlbnwCXQHm82Qa5Twwfxl9/lQxyFkyn08oYf3p4jWPFMXNW5k AcTTWuw3ZkIqt0hICyspPF/u4Ya+yDBj2MioLEczIGsxZbfIKd6wyo9PRAbJ17ptAbOH 6RXoQDNoKbGD23VxJeFvQS4AkaCval7IcRW1u+4IpdFXbQoh+hpwRPX3iJE4w6EvA82M RRhQ== X-Forwarded-Encrypted: i=1; AJvYcCVwNCuw58SRRS1VUcBF5dwaq4APT1DHnnbBF6kkh9FaLIMROFo/gV+GIyjVXttGHLPA2x70yPmy7Ms4@vger.kernel.org, AJvYcCWn40xMlac48wqkcBfteu89xaOKclZW13C/1ABZNPo9WLM3p/b1OqnZiiLlKbw9qGvxrFP1fxExUy81Rsic@vger.kernel.org X-Gm-Message-State: AOJu0YzWetHcmtwvWw+bG0Jv0E/qTn1yKs+IGilFQ+ZSofXL3MR+yTIT 49SwYZxSIUjLGfJvSiARPyFmdUmPcJ7JyeBSny19Pw0RZ/enYPaU X-Google-Smtp-Source: AGHT+IHdDgp5kIe/Uz9eKdMkNiesjGU6gPSz8C0iguDZ2YnuDqyASfy0yI9S6X6wUtplLyyhUB+OQg== X-Received: by 2002:a05:6a20:e68c:b0:1c4:8291:e94e with SMTP id adf61e73a8af0-1cece047a11mr2504621637.45.1725083843358; Fri, 30 Aug 2024 22:57:23 -0700 (PDT) Received: from localhost.localdomain ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2053aa8cb4asm12027045ad.271.2024.08.30.22.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 22:57:23 -0700 (PDT) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, konrad.dybcio@somainline.org Cc: ~postmarketos/upstreaming@lists.sr.ht, Nick Chan Subject: [PATCH v2 3/4] irqchip/apple-aic: Add a new "Global fast IPIs only" feature level Date: Sat, 31 Aug 2024 13:48:18 +0800 Message-ID: <20240831055605.3542-4-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240831055605.3542-1-towinchenmi@gmail.com> References: <20240831055605.3542-1-towinchenmi@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Starting with the A11 (T8015) SoC, Apple began using arm64 sysregs for fast IPIs. However, on A11, there is no such things as "Local" fast IPIs, as the SYS_IMP_APL_IPI_RR_LOCAL_EL1 register does not seem to exist. Add a new feature level, used by the compatible "apple,t8015-aic", controlled by a static branch key named use_local_fast_ipi. When use_fast_ipi is true and use_local_fast_ipi is false, fast IPIs are used but all IPIs goes through the register SYS_IMP_APL_IPI_RR_GLOBAL_EL1, as "global" IPIs. Signed-off-by: Nick Chan Reviewed-by: Sven Peter --- drivers/irqchip/irq-apple-aic.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-ai= c.c index 8d81d5fb3c50..01a3c79054f5 100644 --- a/drivers/irqchip/irq-apple-aic.c +++ b/drivers/irqchip/irq-apple-aic.c @@ -235,6 +235,8 @@ enum fiq_hwirq { }; =20 static DEFINE_STATIC_KEY_TRUE(use_fast_ipi); +/* True if SYS_IMP_APL_IPI_RR_LOCAL_EL1 exists for local fast IPIs (M1+) */ +static DEFINE_STATIC_KEY_TRUE(use_local_fast_ipi); =20 struct aic_info { int version; @@ -252,6 +254,7 @@ struct aic_info { =20 /* Features */ bool fast_ipi; + bool local_fast_ipi; }; =20 static const struct aic_info aic1_info __initconst =3D { @@ -270,17 +273,32 @@ static const struct aic_info aic1_fipi_info __initcon= st =3D { .fast_ipi =3D true, }; =20 +static const struct aic_info aic1_local_fipi_info __initconst =3D { + .version =3D 1, + + .event =3D AIC_EVENT, + .target_cpu =3D AIC_TARGET_CPU, + + .fast_ipi =3D true, + .local_fast_ipi =3D true, +}; + static const struct aic_info aic2_info __initconst =3D { .version =3D 2, =20 .irq_cfg =3D AIC2_IRQ_CFG, =20 .fast_ipi =3D true, + .local_fast_ipi =3D true, }; =20 static const struct of_device_id aic_info_match[] =3D { { .compatible =3D "apple,t8103-aic", + .data =3D &aic1_local_fipi_info, + }, + { + .compatible =3D "apple,t8015-aic", .data =3D &aic1_fipi_info, }, { @@ -750,7 +768,8 @@ static void aic_ipi_send_fast(int cpu) u64 cluster =3D MPIDR_CLUSTER(mpidr); u64 idx =3D MPIDR_CPU(mpidr); =20 - if (MPIDR_CLUSTER(my_mpidr) =3D=3D cluster) + if (static_branch_likely(&use_local_fast_ipi) && + MPIDR_CLUSTER(my_mpidr) =3D=3D cluster) write_sysreg_s(FIELD_PREP(IPI_RR_CPU, idx), SYS_IMP_APL_IPI_RR_LOCAL_EL1); else @@ -990,6 +1009,9 @@ static int __init aic_of_ic_init(struct device_node *n= ode, struct device_node *p if (!irqc->info.fast_ipi) static_branch_disable(&use_fast_ipi); =20 + if (!irqc->info.local_fast_ipi) + static_branch_disable(&use_local_fast_ipi); + irqc->info.die_stride =3D off - start_off; =20 irqc->hw_domain =3D irq_domain_create_tree(of_node_to_fwnode(node), --=20 2.46.0 From nobody Sun Feb 8 14:35:21 2026 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0121E2E405; Sat, 31 Aug 2024 05:57:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725083876; cv=none; b=cpcCQ/zw133l17kQgCml482v+4ffHIhTnCyq7WyABQbP7ZimbylCdGz4swc2vJlYI/8quu6ailnK5GpcKvjraFvxJGj0dAFmbL7KEt/Warfh87DFHTtQJQExzSlzXb3YxJIiOqK3WA7IWeJwqq65qiDvwTvG8V9iYHfwSFrTyyw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725083876; c=relaxed/simple; bh=i1wHNYB9L1TbZMmb7JXpPz2IK/BYlwoGeSiZU2nrtps=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zzd3cvhq3YWNomtikLcqvct9FLH16rR/FT259YRMbmabtj4N+7vU8b4DZ1AbzQ2reFDSKryVfkrZI7Bjw4Ku2ZIgQff5fy5yIpfhetT98anQpjqWi93NN0hEtoadC+Jn10T6JQlaFmjWg5oZZRzpnybW8pxRgprGnxsmEIUG0tA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=etSZMK9h; arc=none smtp.client-ip=209.85.215.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="etSZMK9h" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-6bce380eb96so1435783a12.0; Fri, 30 Aug 2024 22:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725083874; x=1725688674; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c61KzTihCjzePgzXbL4oR36fnoTGJU/hUcEWcyWz+t4=; b=etSZMK9h89sVc4rJc25tqQk0cOa9e2+e3JtFwfU/qBvsr6Ai5y8nIGJnXTdcYRV5zB yujTXZODJx65BsV2pvIBc/9tJVl/V5cudLgDdz2uThpfHn2EQmKXotFvrx+Q4XFfjp03 IbCU9U7xuNr+bUwQ1oyTsJPFSwhGcFTxU1PAtCeYh0u79VCOw11RWDkncSIU6v18uLKH ywKV0n7PgzK+eOBnvkw/v3TP806nPX/3kJmlkPCfNFD97M0ne6BSsakIzPJrQ0Aa5qv2 VYR/9jsRfwdRKhyPnyIdTT2eX6VUYGPtvBH2LYr7G1CDTwpzKKIgCW1w6Yt0UIVBgS5i 5kpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725083874; x=1725688674; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c61KzTihCjzePgzXbL4oR36fnoTGJU/hUcEWcyWz+t4=; b=rcpeAijyQAFmCgOkZK9Z6HgqVjKa2WCsZprST4cCSwOgMHEY137oxDTQoBIeO6GtJC Y/LBMf061byMDvdEYp8KD5efNCYdjrBGIARR9I8/mLxk+S4nCcGNgSYky5WCPMJ5qEY4 z5TC4Lbb4eijxut5LsiKOX1d2VcX80Rlrg6gIDF8qfqVLUDxH8Z7m/yh81Gu1pmbNBY4 asbV+08P3wAJTMJZ3xtdY4VVHKHmMYAYIxhVOOYaA8rhvXAJq7ROlbNy2/5LSe4vIoek N1D1cdmE3CVNWgsxhxj4GyFM2/gequkOCimbOgZvWbGzdVpoK2y3B5djuNUQEAFWUkG6 K0lA== X-Forwarded-Encrypted: i=1; AJvYcCVQry3haUpkvOUgkokHvZlxI1HjZe9qr6UJIU5KwvzW1T8m+tQyLu5E8353eNPtNJGQ2GiRXZUatD3b@vger.kernel.org, AJvYcCXJPsdo5umUXlhr2OZb+e1w/X3sXr2lDfD+yNDWhpSXZGBfVjRNMq13udGTCFyYTx8eQwzOQG0h7haMkSMv@vger.kernel.org X-Gm-Message-State: AOJu0YyyBclYnEu/78TZr83cvYNEFTW1Pi1a1jdrgOR7W5z4t92sPBIt 5SIMVDjPj7HKlud/tltU9opi3XKMb6f9jbvR5tDQkljU74rE3U6N X-Google-Smtp-Source: AGHT+IEYvysVPYow9FSPEgYtUv10qvcbs0XqkpUYakMhxEFHJy0yARyeKD5B3eznnVOi1c96X+YK3w== X-Received: by 2002:a05:6a20:d487:b0:1c4:bbb8:4d02 with SMTP id adf61e73a8af0-1cece5d12cemr2073712637.37.1725083874173; Fri, 30 Aug 2024 22:57:54 -0700 (PDT) Received: from localhost.localdomain ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2053aa8cb4asm12027045ad.271.2024.08.30.22.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 22:57:53 -0700 (PDT) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, konrad.dybcio@somainline.org Cc: ~postmarketos/upstreaming@lists.sr.ht, Nick Chan Subject: [PATCH v2 4/4] irqchip/apple-aic: Only access system registers on SoCs which provide them Date: Sat, 31 Aug 2024 13:48:20 +0800 Message-ID: <20240831055605.3542-6-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240831055605.3542-1-towinchenmi@gmail.com> References: <20240831055605.3542-1-towinchenmi@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Konrad Dybcio Starting from the A11 (T8015) SoC, Apple introuced system registers for fast IPI and UNCORE PMC control. These sysregs do not exist on earlier A7-A10 SoCs and trying to access them results in an instant crash. Restrict sysreg access within the AIC driver to configurations where use_fast_ipi is true to allow AIC to function properly on A7-A10 SoCs. As part of the restriction, the IPI-always-ack path in aic_handle_fiq() has been removed. If the code path were to be reached, the system is fast IPI capable and one of the fast IPI compatibles should be used instead. Signed-off-by: Konrad Dybcio Co-developed-by: Nick Chan Signed-off-by: Nick Chan Reviewed-by: Sven Peter --- drivers/irqchip/irq-apple-aic.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-ai= c.c index 01a3c79054f5..a6d812afb10d 100644 --- a/drivers/irqchip/irq-apple-aic.c +++ b/drivers/irqchip/irq-apple-aic.c @@ -234,6 +234,7 @@ enum fiq_hwirq { AIC_NR_FIQ }; =20 +/* True if UNCORE/UNCORE2 and Sn_... IPI registers are present and used (A= 11+) */ static DEFINE_STATIC_KEY_TRUE(use_fast_ipi); /* True if SYS_IMP_APL_IPI_RR_LOCAL_EL1 exists for local fast IPIs (M1+) */ static DEFINE_STATIC_KEY_TRUE(use_local_fast_ipi); @@ -550,14 +551,9 @@ static void __exception_irq_entry aic_handle_fiq(struc= t pt_regs *regs) * we check for everything here, even things we don't support yet. */ =20 - if (read_sysreg_s(SYS_IMP_APL_IPI_SR_EL1) & IPI_SR_PENDING) { - if (static_branch_likely(&use_fast_ipi)) { - aic_handle_ipi(regs); - } else { - pr_err_ratelimited("Fast IPI fired. Acking.\n"); - write_sysreg_s(IPI_SR_PENDING, SYS_IMP_APL_IPI_SR_EL1); - } - } + if (static_branch_likely(&use_fast_ipi) && + (read_sysreg_s(SYS_IMP_APL_IPI_SR_EL1) & IPI_SR_PENDING)) + aic_handle_ipi(regs); =20 if (TIMER_FIRING(read_sysreg(cntp_ctl_el0))) generic_handle_domain_irq(aic_irqc->hw_domain, @@ -592,8 +588,9 @@ static void __exception_irq_entry aic_handle_fiq(struct= pt_regs *regs) AIC_FIQ_HWIRQ(irq)); } =20 - if (FIELD_GET(UPMCR0_IMODE, read_sysreg_s(SYS_IMP_APL_UPMCR0_EL1)) =3D=3D= UPMCR0_IMODE_FIQ && - (read_sysreg_s(SYS_IMP_APL_UPMSR_EL1) & UPMSR_IACT)) { + if (static_branch_likely(&use_fast_ipi) && + (FIELD_GET(UPMCR0_IMODE, read_sysreg_s(SYS_IMP_APL_UPMCR0_EL1)) =3D= =3D UPMCR0_IMODE_FIQ) && + (read_sysreg_s(SYS_IMP_APL_UPMSR_EL1) & UPMSR_IACT)) { /* Same story with uncore PMCs */ pr_err_ratelimited("Uncore PMC FIQ fired. Masking.\n"); sysreg_clear_set_s(SYS_IMP_APL_UPMCR0_EL1, UPMCR0_IMODE, @@ -830,7 +827,8 @@ static int aic_init_cpu(unsigned int cpu) /* Mask all hard-wired per-CPU IRQ/FIQ sources */ =20 /* Pending Fast IPI FIQs */ - write_sysreg_s(IPI_SR_PENDING, SYS_IMP_APL_IPI_SR_EL1); + if (static_branch_likely(&use_fast_ipi)) + write_sysreg_s(IPI_SR_PENDING, SYS_IMP_APL_IPI_SR_EL1); =20 /* Timer FIQs */ sysreg_clear_set(cntp_ctl_el0, 0, ARCH_TIMER_CTRL_IT_MASK); @@ -851,8 +849,9 @@ static int aic_init_cpu(unsigned int cpu) FIELD_PREP(PMCR0_IMODE, PMCR0_IMODE_OFF)); =20 /* Uncore PMC FIQ */ - sysreg_clear_set_s(SYS_IMP_APL_UPMCR0_EL1, UPMCR0_IMODE, - FIELD_PREP(UPMCR0_IMODE, UPMCR0_IMODE_OFF)); + if (static_branch_likely(&use_fast_ipi)) + sysreg_clear_set_s(SYS_IMP_APL_UPMCR0_EL1, UPMCR0_IMODE, + FIELD_PREP(UPMCR0_IMODE, UPMCR0_IMODE_OFF)); =20 /* Commit all of the above */ isb(); --=20 2.46.0