From patchwork Sun Sep 1 03:40:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 13786245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07F14CA101E for ; Sun, 1 Sep 2024 03:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yH9DpB2vOqWFl9C9V+jaABjITs0KYB7EL4dBUQbha48=; b=pSdbDueCGL63rdm5x6diPB0ya+ w/DoikB2Cfi1RPM11TRsGbhjblMRk9td+YZZNGZU2lrg34UyIB/bgQKFUo1jbqqnrVtAdALcHCOro kJ+sl2b9LJ6B4r0X8P40I5Z+fvy9M/SVrILZS8ojojc3cDTqZZmQ1PQl/FewYRneoQAkY1nhTgxGT FL7onlJ3Gshsv9yKdqSuf+xBMmLz5LFIvXB+jtxrGk3pNpNvIADln3797BTIgk7ckON9d8vhvNdQA qK6g4Gskwwuo/jroHgTU7N7NSVq019fiPge6qDI9AIPxiVdplmHrpW6jhpxT/1eoTLfrwCAEUrr85 i8QOGHoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skbVW-0000000AkgH-1VNT; Sun, 01 Sep 2024 03:44:06 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skbU4-0000000AkNx-1iJ9 for linux-arm-kernel@lists.infradead.org; Sun, 01 Sep 2024 03:42:37 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-7142448aaf9so2081845b3a.1 for ; Sat, 31 Aug 2024 20:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725162155; x=1725766955; darn=lists.infradead.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=yH9DpB2vOqWFl9C9V+jaABjITs0KYB7EL4dBUQbha48=; b=j2NKAhDPcVzFEkFLOPOtqFVwEl50M4d6un4DpFoYv5jKQdLHMZBUiQcjTIKh//lEpm z9XuUq1u3Qv5M2mbMCUkz9+N3jmPMw36iwN1gRgP161nv38726gFrq6P9VLhIA/P99V9 icdhm7ddUG3I9ADqGY5uHVFzJy4ewotPVg805GiIPoDdNnIy93yEmezeyh68WG0r6ar2 EeKfhCxUnZJ5qNG7U2aM0JwEtwDc6GbJrw8jEc0d0Gi96eYEm/ekz99xhhutFOembH3+ KZBE77IZJxDoVXzRjxOTt5toKE3Nke4NMtZjHwV3wCfWG5paS+BraFXo8ZUTKrJ7+EQ3 T4MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725162155; x=1725766955; 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=yH9DpB2vOqWFl9C9V+jaABjITs0KYB7EL4dBUQbha48=; b=Q1IbMMZSnZn1sDKatk1/Datux68IPpteV6F2JDbx9UkBS0cQ3bMGb1Fx7kMWXoRfS2 dKoMmuh+OQ6uHSqxwJjM93KrWgwoHES8tgDKDk1qxgeZ22RQU9OV9K+b+faoWdqCdCHa qmARr0ULWYnABEkzVwF69Q/jzR03FMkbYxK1d9MF13bk4ZGP58SfNwlljp5R9yB596Ty 8G2/iOy8V1BAroEl5McUGV+YdJj1BQwlO+7r39PL5ANQCY536EyshjLzA4MnaLqcZJu5 fPZ7gKN+SGjRGltDTLK0T0a2AsGJfiMOL5M5C4ukbbE3wjp6YH4KtDGbXQSzPdvC8DU2 pwDg== X-Forwarded-Encrypted: i=1; AJvYcCWBl5+TTUN7uWujt0Cqlb0t6K5yMUK4bjwdS3OIhmOn86LnekzmkbYFArMiuvZIlSgfl0K50Z6z5aILeGfhjPiX@lists.infradead.org X-Gm-Message-State: AOJu0YwVCWcUT133Av8HEU+HH3KFEjAaJc/d3sGPhnefDD/MNydQ7Tl4 jVLrq8g3fQmovos07LcvZ/+AESNLT15BxiCHxRum33Csh9dmzBwu X-Google-Smtp-Source: AGHT+IEObdUwisREopDN74WlXGu+MwK3ECILVmBEK+u0lfuO5t0y0gHsYBPq4cQjNKSsi8PuduAg6w== X-Received: by 2002:a05:6a00:181a:b0:714:2922:7c6d with SMTP id d2e1a72fcca58-715e101f8d7mr19711987b3a.12.1725162155177; Sat, 31 Aug 2024 20:42:35 -0700 (PDT) Received: from localhost.localdomain ([49.130.72.113]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-715e55771ccsm4826767b3a.43.2024.08.31.20.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 20:42:34 -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 Cc: ~postmarketos/upstreaming@lists.sr.ht, konrad.dybcio@somainline.org, Nick Chan , Krzysztof Kozlowski Subject: [PATCH v3 1/4] dt-bindings: apple,aic: Document A7-A11 compatibles Date: Sun, 1 Sep 2024 11:40:04 +0800 Message-ID: <20240901034143.12731-2-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240901034143.12731-1-towinchenmi@gmail.com> References: <20240901034143.12731-1-towinchenmi@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240831_204236_469817_0C5A2D45 X-CRM114-Status: GOOD ( 13.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Acked-by: Krzysztof Kozlowski Reviewed-by: Sven Peter Signed-off-by: Nick Chan --- .../bindings/interrupt-controller/apple,aic.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/apple,aic.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. + 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 from + 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# 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 interrupt-controller: true From patchwork Sun Sep 1 03:40:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 13786246 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D43E1CA101E for ; Sun, 1 Sep 2024 03:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5X+/CCCJdHsPQtIkli72FdNOUA83CpBm1xJ/DRLJla8=; b=b869+xC4a+E52SFM53H5xkgkNc N81HsHk+iZr+qzL/f5tEK0CYKKCVIu7rZ/o62PCqgVpirtzhBnuyyNhXlmfZv0bK/P4edy8WT9Bi2 xK1n5PNXtmzrcksWt9OhyWUPLnkLcmsHzEfyxWhAvLaiPItjjDbT8wOMHNt8Rrygg6ESuO5LtQeuv 5tiYhATa1ilC7i13uSl8r5Mkjtlhvhk75bn83/SVqEYkFSg84zRZ5wP2dxqIzahf8e03xfUtsLzQx yRWTwje6zjCmjoR05HLyU+eeLK58UvaFCCEGeroVdR+hEldXAHMY0A7lkpUXdVzYBdxxJnvrWtpBx XsVH4rGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skbWL-0000000Aknt-29Nm; Sun, 01 Sep 2024 03:44:57 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skbU9-0000000AkOY-3mWc for linux-arm-kernel@lists.infradead.org; Sun, 01 Sep 2024 03:42:43 +0000 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-714262f1bb4so2426808b3a.3 for ; Sat, 31 Aug 2024 20:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725162161; x=1725766961; darn=lists.infradead.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=5X+/CCCJdHsPQtIkli72FdNOUA83CpBm1xJ/DRLJla8=; b=VGWk7+mt4U2mhTT+9EWlY6hQ+Qmx+stZBzW+GsqfDGmBKtLpxkQ4ruaEcVUMkg5zZ+ JQbdeZJGMZ3Lum1cmTU+qyyqpG+aj4DgKApovuYxqWvOq+1RIIeHGTC5Ke7G1DMr4UdZ bd7g5v2oz63SCUnUhS2LiVGfry7RKjAp36kjRmCCtyqHWb/kTo6H2ChUhiN9YnQMwsRF HFsTUHPKJWIqsnitq1BnP9hhtnZ1da0WlAUdwTzrGKe2AKNXFgyXALAcalV0AJPkPfah EO6GaT/eI8KP+6Mgy8uyvrMGn0+OpPguCfjaFSXVg+rMj5QTUhE2UXZqWUvS0I7teFd5 cPBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725162161; x=1725766961; 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=5X+/CCCJdHsPQtIkli72FdNOUA83CpBm1xJ/DRLJla8=; b=wZPM0yF59OLNWMLNbzeeZILPAsQzLpLj9WlpBFcFniH98caWpHDOTsbjDuKLpgAyiJ fq8qLcgO9TI986OfPa7ZMXgR+iod+zZNmlxhZHNuegn49w6EpxY+Tu5JLKD2k03Q3MVQ orcbNBI24nX7gC/xFEvT46pxKo2t5OqmarfugiC3hF3Y2TIo9yTloOHXj+CnFzsxrqrJ uraL47LbYpOSm+/aa/ic+O82kb+DckaIdUDr++ux7OCOTEoNDqJhcs5hipl6ZNsnzmXS hkxowUbGkDKClY3pKiXlEPMiAUJvZa/yjXkayXNKCF/BC4CXxtOTpn3FgDmVMFi8QfTo 7+yg== X-Forwarded-Encrypted: i=1; AJvYcCVvuYLY7KOcqf+8VbqnCJ79VhqzTyProgOnR/qtjyMQpQO9qSerLf2oX100w3hl2ACQYkwtL23BKSBxUGsRrkzF@lists.infradead.org X-Gm-Message-State: AOJu0YzTkchIDIUSlzUM+bf5IEtw0Kb6mtXvX9wLbN+1wDANVCFSK/tG cVRcGJHYFcGvYivWUE0GF7ynYhljkqg3sZWt9RqBzBSLEys/j8rV X-Google-Smtp-Source: AGHT+IErgWsZXv7smRglnCflkeOjudhULFolSyci/zrSk+ZWtbqCA1BERr3NORnUsdJcn5DSCwfNaw== X-Received: by 2002:a05:6a00:1786:b0:714:1d96:e6bd with SMTP id d2e1a72fcca58-7173fa7c84dmr2181901b3a.13.1725162160903; Sat, 31 Aug 2024 20:42:40 -0700 (PDT) Received: from localhost.localdomain ([49.130.72.113]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-715e55771ccsm4826767b3a.43.2024.08.31.20.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 20:42:40 -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 Cc: ~postmarketos/upstreaming@lists.sr.ht, konrad.dybcio@somainline.org, Nick Chan Subject: [PATCH v3 2/4] irqchip/apple-aic: Skip unnecessary setting of use_fast_ipi Date: Sun, 1 Sep 2024 11:40:05 +0800 Message-ID: <20240901034143.12731-3-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240901034143.12731-1-towinchenmi@gmail.com> References: <20240901034143.12731-1-towinchenmi@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240831_204241_959333_299B72D8 X-CRM114-Status: GOOD ( 12.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org use_fast_ipi is true by default and there is no need to "enable" it. Reviewed-by: Sven Peter Signed-off-by: Nick Chan --- 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-aic.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 *node, struct device_node *p off += sizeof(u32) * (irqc->max_irq >> 5); /* MASK_CLR */ off += sizeof(u32) * (irqc->max_irq >> 5); /* HW_STATE */ - if (irqc->info.fast_ipi) - static_branch_enable(&use_fast_ipi); - else + if (!irqc->info.fast_ipi) static_branch_disable(&use_fast_ipi); irqc->info.die_stride = off - start_off; From patchwork Sun Sep 1 03:40:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 13786247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24F98CA101E for ; Sun, 1 Sep 2024 03:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8P/VLH/bkCVi0Kmx8/pRYs60oDjzwE57I92YjRqe88o=; b=eGVQmNc3c786DdPGBuoy0INYqq lPaC//HyqSnO9HU5YDok9egWiyDFGP0mURJjrDiGqXn7nAtfkBq/A+sY6uEzPzrB6j2B1jph/F+V1 lE1cOP5e3L3ofRuaq/wyWzAg64XlwR6Ztr1EdSg0nPFVIY1yYxH64WWYuUhKgZHJK/f6jNwHSEi2s PBjOxtSQu+2tq+ARHDo1E7vGq8uNZ3sXip1nBL+WJUA/Z0TwOOj986RScM7tW4ta/A+/J42LkpvJP JWKwKzOAgBywHGKdF+sUzWRCokbAiNUhavaX1jvg9/zZiiRBKSssOE0TuLr+CbRqwGzFJNB5TuUJT l5tT5L+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skbXC-0000000AkvT-1wtR; Sun, 01 Sep 2024 03:45:50 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skbUF-0000000AkPg-3J0y for linux-arm-kernel@lists.infradead.org; Sun, 01 Sep 2024 03:42:49 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-71456acebe8so2480170b3a.3 for ; Sat, 31 Aug 2024 20:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725162167; x=1725766967; darn=lists.infradead.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=8P/VLH/bkCVi0Kmx8/pRYs60oDjzwE57I92YjRqe88o=; b=XYb3nvteMCCfzFL5SFg18+YkYccNEcGfmKyNCF0q2Pdx9AcgWnzFfDVZjQZ1Zz9KU1 wBPQJXvUWXUCjOi4CDL8iwQth0MOLDca2Cko8wmuWPBYp1/oECgnIdtpQuUQdDvzzolb salDbHILFN07cAhgmGt6DQJBggoFJ5oiCMDqYfIHlD3IWiKz4AL4LcfGlxaJm5YRMbto +Z4mhVAU53tayvxB7O6VW/ZGM6s/Rd/YvjNyaC745MhZhYIiIOmirtdPu33JsoBw7tl7 IsjF2JzemVEjLYH7P1SPxDi/jIiRtbHt8UicokLGVElYowVQJdkBWJ+peRw8UQdVVRYV E/Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725162167; x=1725766967; 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=8P/VLH/bkCVi0Kmx8/pRYs60oDjzwE57I92YjRqe88o=; b=Mf9617WqE4VQnh+SG/wldH2S/PQTueNBGIV/jR5q9/zaKUvu6TsUd02d4SNqRFoh+R 9PHuqORwQyed5bzOv5UCuT9emDK0wnfderQfy+u/Cn6Lj0r33NZo/Uxl0bzYWYNYHsrl UIR+2CNeu62IdES+bXORqMDGC8yYREktpLwPrrAtGIvkhDqIrXnR7Z3aQlWi1eVPA0BW UQRN/2VHBPx0HT8ejLJlqFxq9HLQAg5RPZjRzYMSgf7prIGRbnybzYfaXvelOTJqMkua 11PcBpZeJQpB38AyPMZGWkn9YAiW0PBLfY5tI6sgGSVKckq9621PaYQXGtFEO+pdphqk l4Lg== X-Forwarded-Encrypted: i=1; AJvYcCX8kWh9uQA4bjqMU+n99q41+uV/qF5hlgXu5lITFQTR94vxhuvkWe5/yeuUs3J3bJnaA2AcnFWMiaI2qFzNnG7L@lists.infradead.org X-Gm-Message-State: AOJu0YzIesH9P+qt7Ancq3tDZDE/F8Hadhggczarq2vuLKMh56449Cpn 0K7T+yxtIJ24WTdF+6OTZCJjPYWELlaeJQy39sZWDhMQe0jdfT7x X-Google-Smtp-Source: AGHT+IFhht1qKXBiPs9HIAzfuSOxGKr51cNM8GUgWfxyXslOI4NWrGfhD0H/m6YtWxDBqqE9Ki9wQA== X-Received: by 2002:a05:6a00:928d:b0:706:5cd9:655d with SMTP id d2e1a72fcca58-715dfc3a4f1mr12316514b3a.22.1725162167046; Sat, 31 Aug 2024 20:42:47 -0700 (PDT) Received: from localhost.localdomain ([49.130.72.113]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-715e55771ccsm4826767b3a.43.2024.08.31.20.42.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 20:42:46 -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 Cc: ~postmarketos/upstreaming@lists.sr.ht, konrad.dybcio@somainline.org, Nick Chan Subject: [PATCH v3 3/4] irqchip/apple-aic: Add a new "Global fast IPIs only" feature level Date: Sun, 1 Sep 2024 11:40:06 +0800 Message-ID: <20240901034143.12731-4-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240901034143.12731-1-towinchenmi@gmail.com> References: <20240901034143.12731-1-towinchenmi@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240831_204247_859509_36F55E8D X-CRM114-Status: GOOD ( 17.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Reviewed-by: Sven Peter Signed-off-by: Nick Chan --- 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-aic.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 { }; 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); struct aic_info { int version; @@ -252,6 +254,7 @@ struct aic_info { /* Features */ bool fast_ipi; + bool local_fast_ipi; }; static const struct aic_info aic1_info __initconst = { @@ -270,17 +273,32 @@ static const struct aic_info aic1_fipi_info __initconst = { .fast_ipi = true, }; +static const struct aic_info aic1_local_fipi_info __initconst = { + .version = 1, + + .event = AIC_EVENT, + .target_cpu = AIC_TARGET_CPU, + + .fast_ipi = true, + .local_fast_ipi = true, +}; + static const struct aic_info aic2_info __initconst = { .version = 2, .irq_cfg = AIC2_IRQ_CFG, .fast_ipi = true, + .local_fast_ipi = true, }; static const struct of_device_id aic_info_match[] = { { .compatible = "apple,t8103-aic", + .data = &aic1_local_fipi_info, + }, + { + .compatible = "apple,t8015-aic", .data = &aic1_fipi_info, }, { @@ -750,7 +768,8 @@ static void aic_ipi_send_fast(int cpu) u64 cluster = MPIDR_CLUSTER(mpidr); u64 idx = MPIDR_CPU(mpidr); - if (MPIDR_CLUSTER(my_mpidr) == cluster) + if (static_branch_likely(&use_local_fast_ipi) && + MPIDR_CLUSTER(my_mpidr) == 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 *node, struct device_node *p if (!irqc->info.fast_ipi) static_branch_disable(&use_fast_ipi); + if (!irqc->info.local_fast_ipi) + static_branch_disable(&use_local_fast_ipi); + irqc->info.die_stride = off - start_off; irqc->hw_domain = irq_domain_create_tree(of_node_to_fwnode(node), From patchwork Sun Sep 1 03:40:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 13786248 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 677BACA101E for ; Sun, 1 Sep 2024 03:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9Jlw7myxYxrx+WOkTkEU/GjLvfU58jir7qbTQIyRSl8=; b=GK5Hbzu0UKY6kLHrB8iGMtQxL7 Xj13h89wTkEu4ZtFTFkqGbn+SikK1HNk3Nq2KN9600DYvgbi7osn2ACiv3TsPh8mP8BCAmH/Qljw/ 8h54whP6zpRheUB9ojnG+dIN3Rp3I0PeW5jTI00ED6p6ilDFQQyKCRnXvM3jbk/ZNyxIVR2Nt+QwC cKYd3qv9wUjHkRJgaufIGBPwZ7yGmmiR5tHx6SfkDUoNon1SgSvnvrw5/bsmQD4ZuOGTImMoUEpt1 iBsu1V1h7F4h8BNNibtzE+HKYonsQf4rToBH+Ms6zv1OpESkdoYFqO5QrhaYCwXgGtE3tDUwGW+dL 7XKKctaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skbY2-0000000Al2K-1HBs; Sun, 01 Sep 2024 03:46:42 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skbUL-0000000AkS1-3hu6 for linux-arm-kernel@lists.infradead.org; Sun, 01 Sep 2024 03:42:55 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-715cdc7a153so2242233b3a.0 for ; Sat, 31 Aug 2024 20:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725162173; x=1725766973; darn=lists.infradead.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=9Jlw7myxYxrx+WOkTkEU/GjLvfU58jir7qbTQIyRSl8=; b=eNHR9HqNdeof2cSBF1YXOIHbA+nCqZgahcLDo8e+B1ZBVEHs0accXiXCB9kQhNtqRf eD4gCb2m7Xghqw1rZPHtIq2+1rwJU8lG+6ndVDURoUplZMiKUTMYQS2CaaMcn0/6Im+z XOGuT2mGuUyXJg71q+xT9CU5Tzc+KRbUAvVSb7X53Pj6d3ALDeUZvAkFFbWQ0IC/poA2 53uiS7CY+9G9lkXrd8iPJ+WSRWib09DsGkS+pc2dDctkdlqdZJLlcWoxET4sfFjmBtMl 3P0K0We29xr+X/sgxj8/Bf6jcgXZHQrexjifPQX1qPqperwpI53Ci/Mf+2NncLgpIJoQ ieaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725162173; x=1725766973; 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=9Jlw7myxYxrx+WOkTkEU/GjLvfU58jir7qbTQIyRSl8=; b=GImHrvvhTgQND/H0eq7ENds3ruW1eXUBskjssYoCNZe4gHvWeNm17o5bWX1WwikBkX KIL4ndTNMGnscJoORb1tzg0Q4sT50UmR7lp5eWzpCiH1nprpHJVjUo0aClDO2/IYplMB gu2VPwtvsP0SoahCN59CIn2c0njlt35zSLpUqLVbP1/23S/+VTCvy71e+1SwSXBUH6Z/ NKyAopOgbt1S7oaodtBu24GYgnAqE9I2CkVYEZiE9BEaI6SpKgkebQ4ghPsbofZHARqK oA73SVEYrw1ApszOQGwgS6dqqAR7kvnG/gJStyq/JP1jBnqpdP3dbpGZJFFWnZ8lKj6C 6qhA== X-Forwarded-Encrypted: i=1; AJvYcCVN9M6NqTr+IaX2AKsqvXOHH3t+I/aepXGQjgi+PRkY6+pRVKM6ttA5cWZ/qvAzQQziO5K54/cbRO3S8C2JDuQy@lists.infradead.org X-Gm-Message-State: AOJu0YxejeINefuFblJxJe+Z7d6K643dsJ7zxkILvUJMaRk1K7V/5jMH pFGbQjPi4oT557MX5VZavgV5zqyr5dsN/uhuBXlJnwYisS98VlDP X-Google-Smtp-Source: AGHT+IHc5YknrxzXlFuucuStWx3gBFqQRQQwKvn1lhHqX/o6iunywxLlE/ficJuzfPbWPY8NggTDHA== X-Received: by 2002:a05:6a00:1905:b0:712:7512:add9 with SMTP id d2e1a72fcca58-7170a85ab58mr10551336b3a.13.1725162172772; Sat, 31 Aug 2024 20:42:52 -0700 (PDT) Received: from localhost.localdomain ([49.130.72.113]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-715e55771ccsm4826767b3a.43.2024.08.31.20.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 20:42:52 -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 Cc: ~postmarketos/upstreaming@lists.sr.ht, konrad.dybcio@somainline.org, Nick Chan Subject: [PATCH v3 4/4] irqchip/apple-aic: Only access system registers on SoCs which provide them Date: Sun, 1 Sep 2024 11:40:07 +0800 Message-ID: <20240901034143.12731-5-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240901034143.12731-1-towinchenmi@gmail.com> References: <20240901034143.12731-1-towinchenmi@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240831_204253_948093_4A066499 X-CRM114-Status: GOOD ( 14.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Reviewed-by: Sven Peter Signed-off-by: Konrad Dybcio Co-developed-by: Nick Chan Signed-off-by: Nick Chan --- 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-aic.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 }; +/* True if UNCORE/UNCORE2 and Sn_... IPI registers are present and used (A11+) */ 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(struct pt_regs *regs) * we check for everything here, even things we don't support yet. */ - 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); 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)); } - if (FIELD_GET(UPMCR0_IMODE, read_sysreg_s(SYS_IMP_APL_UPMCR0_EL1)) == 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)) == 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 */ /* 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); /* 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)); /* 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)); /* Commit all of the above */ isb();