From patchwork Wed Jul 29 05:22:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 11690355 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CC376C1 for ; Wed, 29 Jul 2020 05:19:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E87EF20825 for ; Wed, 29 Jul 2020 05:19:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qHpWviH9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbgG2FTi (ORCPT ); Wed, 29 Jul 2020 01:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgG2FTi (ORCPT ); Wed, 29 Jul 2020 01:19:38 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E3ACC061794 for ; Tue, 28 Jul 2020 22:19:38 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id t6so11288370plo.3 for ; Tue, 28 Jul 2020 22:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=ewZZRdK/39FBGeOZ2tdi5SzHsAw8yPQ4ikGUHdjm5hs=; b=qHpWviH9HPFswtRVxclGSvtvOrc6xoZxCcAr+u7ZrCbUyYya31xDpWaAZBv2kvzS91 qWxxgy/9jLQIKQoPMgIB8dg73zqBv08flkULGIyzobt3jErpA4rVkVQjwnqQw1S0UZjY FNroOeQXz+5UfOlH+jadnDH2P1KEQpN4JAAQm7oM+cnB3sNEvKt7qlJvw+C86uJHVtKC cB3xIGrCH7Gy2kHSRU4S6ceji1mHcWIy4IteOrNIcmWTLayNJFftMhJUzZJTkASmqU3k XdpIOdKN4S0i+2d+FykkZ7IBht/DREnKDo+rHDpu3QQbgUgTsON+qsqwyILeXpU8Wuqd Tx3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=ewZZRdK/39FBGeOZ2tdi5SzHsAw8yPQ4ikGUHdjm5hs=; b=gFEMoahxJjvyr+q9HWJ/a8AsFXE/HhP1g6mZV8YtfwzgSk/FxNudQtkWQoewZxz2t2 zo5ORmvNRwxgxFR90dWA35Yy4ByCY049s9SS2BuhLh9Op/u18uobuXgdbMtrkMTQlJtc Fwr/ZCKWqrFmJTis3Hd5VjA4OZKVUBLrCt2CyDom3/jSbrrxy+g9PUa1CWuiINVHm8QC eaHKGNG4eQiyd9HYQBCy9Ti2D+aqzyhSb47DTncDzw48Usa1nEbjosknhxRsdaET9moy uwxOns1Ebaqg6bWCV/4d5cwut1Resyy9BtZ9gGOx3IKkwxuso9ZYHrTS3+kbhL8Mjh8V DIww== X-Gm-Message-State: AOAM533PIAtgu0QycHZQp0LrVrg8Knx/v6rlZmM39FTNLfhTsnd6b+Vi zUpZi9JipJhw3GWZdflLnXU= X-Google-Smtp-Source: ABdhPJz3o0TsfQB/3LKddJMtFU+H2muKyWveQX3Skfj2pXYMyqZ1vdm/yZt4u69mCp4bRFoo1RXcAA== X-Received: by 2002:a17:90a:ea8e:: with SMTP id h14mr7873159pjz.105.1595999977737; Tue, 28 Jul 2020 22:19:37 -0700 (PDT) Received: from software.domain.org (28.144.92.34.bc.googleusercontent.com. [34.92.144.28]) by smtp.gmail.com with ESMTPSA id l4sm739539pjr.46.2020.07.28.22.19.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2020 22:19:37 -0700 (PDT) From: Huacai Chen To: Thomas Bogendoerfer , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring Cc: linux-mips@vger.kernel.org, Fuxin Zhang , Huacai Chen , Jiaxun Yang , Huacai Chen Subject: [PATCH 1/5] dt-bindings: interrupt-controller: Update Loongson HTVEC description Date: Wed, 29 Jul 2020 13:22:06 +0800 Message-Id: <1596000130-8689-1-git-send-email-chenhc@lemote.com> X-Mailer: git-send-email 2.7.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Loongson HTVEC support 8 parents interrupts in maximum, so update the maxItems description. Signed-off-by: Huacai Chen Reviewed-by: Jiaxun Yang --- .../devicetree/bindings/interrupt-controller/loongson,htvec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/loongson,htvec.yaml b/Documentation/devicetree/bindings/interrupt-controller/loongson,htvec.yaml index e865cd8..87a7455 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/loongson,htvec.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/loongson,htvec.yaml @@ -22,8 +22,8 @@ properties: interrupts: minItems: 1 - maxItems: 4 - description: Four parent interrupts that receive chained interrupts. + maxItems: 8 + description: Eight parent interrupts that receive chained interrupts. interrupt-controller: true From patchwork Wed Jul 29 05:22:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 11690357 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E545913B1 for ; Wed, 29 Jul 2020 05:20:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC7C22070B for ; Wed, 29 Jul 2020 05:20:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iDeSfvGC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbgG2FUP (ORCPT ); Wed, 29 Jul 2020 01:20:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbgG2FUP (ORCPT ); Wed, 29 Jul 2020 01:20:15 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ECADC061794 for ; Tue, 28 Jul 2020 22:20:15 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id w17so11271291ply.11 for ; Tue, 28 Jul 2020 22:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=wgl47zlXLMmHZ6eEnoQJBs9qSoBOoLqIxj7epSy1h8w=; b=iDeSfvGC71I9U3K2ZCwFkvEJkzM/d6d5nYOnxa+1KsD6ljTlTMnZrhdZbeVx6IOVhF b1jS6dBnpo9VEp1i/O5mMj3y9Ajlr2zupP/KNnCXEo2viOZR1PWZ9LMmdSFscwYb1a89 a48SjCUZTJ8xvOXmJG8YNrm8lHT/gsw2b+lOpUnGiZIuOwMHnCZCJk6PaDCZro7Bv0Ok NtttaUjkLp0iCgs8LTurgj4KloKAaeKhYLgbRQHJhfHRMlqWxrEwPi9G/MOHoNfVSTQD BotbEfqbpY15i7nsUlCDB6Byd5/8tFxZSUobdcrUbaeoZRYB6bsKSTneVDcA/yV2kIkd a1ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=wgl47zlXLMmHZ6eEnoQJBs9qSoBOoLqIxj7epSy1h8w=; b=mXXatSBlwRYfK2LD10A02HYtJSbjZVNNwhcgLWiYoKlm2lLIveauzBhv+JDYufsVEA +/T5tFUCX2t9NlJHfL6jCXCuuFsd88VKCgsNcDE7uiqAu9h3owwA2vD5yRm0XSHpgYUU M843UsChVccoH/MgLk6tEnNLfyyKmEsrTrzkDmOx0dM8nTUgMOUsp9ADiF0kUTYHaLKQ XIDXA3bVCJcfJ93wnubrlFYMUYXiZCVe3nOLpgrXtGhimL8qrkB8zhgycf5B2woh2aMi NYIU/w8S+XkKrcbMIoqvreFWsYd9ZZiKLknGiyPU8VlVRkjh/WdsYR7bM+U8zlQJDdAw yulA== X-Gm-Message-State: AOAM533aednRiNrAtCGU6Ez4DPo8+p3wTIgXUmp2BKZL4LcrUI6HAifG sEWX9WkP6ulkv8wodyC8kl0= X-Google-Smtp-Source: ABdhPJzXURjIVyqhfHtWZngMUHMAV1b3NqT9VBPtTJDD/rsFVyopdHF0NVo+7i24WfL/YHIFgo3PVQ== X-Received: by 2002:a17:90b:1116:: with SMTP id gi22mr8323651pjb.8.1596000014822; Tue, 28 Jul 2020 22:20:14 -0700 (PDT) Received: from software.domain.org (28.144.92.34.bc.googleusercontent.com. [34.92.144.28]) by smtp.gmail.com with ESMTPSA id l4sm739539pjr.46.2020.07.28.22.20.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2020 22:20:14 -0700 (PDT) From: Huacai Chen To: Thomas Bogendoerfer , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring Cc: linux-mips@vger.kernel.org, Fuxin Zhang , Huacai Chen , Jiaxun Yang , Huacai Chen Subject: [PATCH 2/5] MIPS: DTS: Fix number of msi vectors for Loongson64G Date: Wed, 29 Jul 2020 13:22:07 +0800 Message-Id: <1596000130-8689-2-git-send-email-chenhc@lemote.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1596000130-8689-1-git-send-email-chenhc@lemote.com> References: <1596000130-8689-1-git-send-email-chenhc@lemote.com> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org HT irqs vectors are 8 groups, each group has 32 irqs, Loongson64C CPUs can use only 4 groups and Loongson64G CPUs can use all 8 groups. So the number of msi vectors of Loongson64G is 192 (32*8 - 64 = 192). Signed-off-by: Huacai Chen --- arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts b/arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts index bdc911e..c945f85 100644 --- a/arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts +++ b/arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts @@ -20,7 +20,11 @@ interrupts = <24 IRQ_TYPE_LEVEL_HIGH>, <25 IRQ_TYPE_LEVEL_HIGH>, <26 IRQ_TYPE_LEVEL_HIGH>, - <27 IRQ_TYPE_LEVEL_HIGH>; + <27 IRQ_TYPE_LEVEL_HIGH>, + <28 IRQ_TYPE_LEVEL_HIGH>, + <29 IRQ_TYPE_LEVEL_HIGH>, + <30 IRQ_TYPE_LEVEL_HIGH>, + <31 IRQ_TYPE_LEVEL_HIGH>; }; }; @@ -31,7 +35,7 @@ interrupt-controller; msi-controller; loongson,msi-base-vec = <64>; - loongson,msi-num-vecs = <128>; + loongson,msi-num-vecs = <192>; interrupt-parent = <&htvec>; }; }; From patchwork Wed Jul 29 05:22:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 11690363 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E4F413B1 for ; Wed, 29 Jul 2020 05:21:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65AFD20838 for ; Wed, 29 Jul 2020 05:21:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lMM9W7v4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726208AbgG2FVC (ORCPT ); Wed, 29 Jul 2020 01:21:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgG2FVB (ORCPT ); Wed, 29 Jul 2020 01:21:01 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B74FAC061794 for ; Tue, 28 Jul 2020 22:21:01 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id k27so13655565pgm.2 for ; Tue, 28 Jul 2020 22:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Yn6T+ydwl7t04EuWlZ6rQm0TIidTqiY2rykbdkGbhsw=; b=lMM9W7v4OPQqECfr4szNZkA19dmNn4QoKb3XijzZ6c/WMXBWUwlwcCKAKrE/TkgIM2 DUV4yn5Hw3cH+7Ud0nJ6M3Q+LiWQdHjRSj5FBMwNAMHmFB36vJwCY3ipSdVgZkWz7rUz G5e31fCIRqK354Zh243bHz8o7AWCYqum9goUqvit5MtPM2z6IybOQnYq/JCYIkxEhpOU zbqqjcaeguesXStzA1DPUhnlbRFUyU4PzUs5CvE/JpNmUcyMQbfyLsipEhykYnP6C3Nh uXbnYXFHLij7OpOegs96xWt5v8YPf1IJCGla6345CoJFI3Y3dobebcA4ZnqlIauPmj4E 4jUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Yn6T+ydwl7t04EuWlZ6rQm0TIidTqiY2rykbdkGbhsw=; b=nZttsCD4Grd3BxL9RrK9Us2vp2h6YHH+zmWvzhIfL6WKmIkygK+QiH6ZSZnzHT5hYd O0m1Sau293mQ6j90hSNZ0YO6eP02Di/BKSI2QE2l/JnKcVvIfXFQvZ5fjTCYyp6OeSkM ErKt4sMhrMAXwydycNxkF29W8aMgCvPeAAZee7hxApnf/jyLsDWtM9gZ7gXFgu7HnqV+ hYSbi/5J8LmULCaz6cwmemkED7iaECeHJdf+95qbejeO0MCvZk0Yv/XPKfsWehb7egGZ +CK4mvaKdqv2YBJztkZCSK7y0Zh0c0PyZ5w52FEpWOthsacVGpj1uW905M+SV06MWWGP uGSw== X-Gm-Message-State: AOAM5314F8Dwwi8+ovNM1x4zdHCM+iQ0gKl85Mk98N9mFZN7wLCj4gbJ 7TQlRrkylAw68dfVz/pU2E0= X-Google-Smtp-Source: ABdhPJyKH53i5bE9xWCkQuCIiwtHb4EZ+nOi/TXEAVtULa6mqR5NsZI2+GR2jKF8ciwhqsub31ClYw== X-Received: by 2002:aa7:988e:: with SMTP id r14mr28454110pfl.35.1596000061354; Tue, 28 Jul 2020 22:21:01 -0700 (PDT) Received: from software.domain.org (28.144.92.34.bc.googleusercontent.com. [34.92.144.28]) by smtp.gmail.com with ESMTPSA id l4sm739539pjr.46.2020.07.28.22.20.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2020 22:21:00 -0700 (PDT) From: Huacai Chen To: Thomas Bogendoerfer , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring Cc: linux-mips@vger.kernel.org, Fuxin Zhang , Huacai Chen , Jiaxun Yang , Huacai Chen Subject: [PATCH 3/5] irqchip: loongson-liointc: Fix misuse of gc->mask_cache Date: Wed, 29 Jul 2020 13:22:08 +0800 Message-Id: <1596000130-8689-3-git-send-email-chenhc@lemote.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1596000130-8689-1-git-send-email-chenhc@lemote.com> References: <1596000130-8689-1-git-send-email-chenhc@lemote.com> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org In gc->mask_cache bits, 1 means enabled and 0 means disabled, but in the loongson-liointc driver mask_cache is misused by reverting its meaning. This patch fix the bug and update the comments as well. Signed-off-by: Huacai Chen Reviewed-by: Jiaxun Yang --- drivers/irqchip/irq-loongson-liointc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c index 63b6147..08165c5 100644 --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -60,7 +60,7 @@ static void liointc_chained_handle_irq(struct irq_desc *desc) if (!pending) { /* Always blame LPC IRQ if we have that bug */ if (handler->priv->has_lpc_irq_errata && - (handler->parent_int_map & ~gc->mask_cache & + (handler->parent_int_map & gc->mask_cache & BIT(LIOINTC_ERRATA_IRQ))) pending = BIT(LIOINTC_ERRATA_IRQ); else @@ -131,11 +131,11 @@ static void liointc_resume(struct irq_chip_generic *gc) irq_gc_lock_irqsave(gc, flags); /* Disable all at first */ writel(0xffffffff, gc->reg_base + LIOINTC_REG_INTC_DISABLE); - /* Revert map cache */ + /* Restore map cache */ for (i = 0; i < LIOINTC_CHIP_IRQ; i++) writeb(priv->map_cache[i], gc->reg_base + i); - /* Revert mask cache */ - writel(~gc->mask_cache, gc->reg_base + LIOINTC_REG_INTC_ENABLE); + /* Restore mask cache */ + writel(gc->mask_cache, gc->reg_base + LIOINTC_REG_INTC_ENABLE); irq_gc_unlock_irqrestore(gc, flags); } @@ -243,7 +243,7 @@ int __init liointc_of_init(struct device_node *node, ct->chip.irq_mask_ack = irq_gc_mask_disable_reg; ct->chip.irq_set_type = liointc_set_type; - gc->mask_cache = 0xffffffff; + gc->mask_cache = 0; priv->gc = gc; for (i = 0; i < LIOINTC_NUM_PARENT; i++) { From patchwork Wed Jul 29 05:22:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 11690365 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CB0B1392 for ; Wed, 29 Jul 2020 05:22:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32C642070B for ; Wed, 29 Jul 2020 05:22:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hx7BMafE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726203AbgG2FWC (ORCPT ); Wed, 29 Jul 2020 01:22:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbgG2FWB (ORCPT ); Wed, 29 Jul 2020 01:22:01 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0A44C061794 for ; Tue, 28 Jul 2020 22:22:01 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id d4so13647082pgk.4 for ; Tue, 28 Jul 2020 22:22:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=kw4YlohL0M2SfPo2yS24Fc01FPImFy877KGaEp7/Zrs=; b=Hx7BMafEz9pY82Mq9xffnhXYeIgqq5RwJI7C23Zm32DdF0drkDXqwYwGKKXOHDhvqn 5POER9Gn1AxxbigYucKWQxTxjjoHC7jkOKLmSx3xTsTqZz0g12VwfqSb+mGswVPNWmH2 LwUJfcpz/Z7/vPs8Axoct7igsmSdgvhia0L2R42Hd/VnIAhwkTC1h3sH71fojskDp5Om CiESwvQS9X/iP0RFSZxdliTnL+KkfRrUb2OOGP7dJ9IC8Pzr3cpufI5anU822DbJsvH7 TiRQw9mmxDw4mbkvHMs8Oy2OwyJAlvfijKwKfKpOtnK8aUZitrGn9lTbbTL3WGN6Jgf5 ZnVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=kw4YlohL0M2SfPo2yS24Fc01FPImFy877KGaEp7/Zrs=; b=QZ2D3MAvvWLGag8QoQ8FrVZZJxl4NzVbSQM6Dn9xLJRrUD1m2qAsCJD1UUBfgiLqFe lgVU3hH7+WpRThmeT7t7PrFJVD5dYwGFdh265FZZXLDjj2NoAZzXtF3+UAgqRfJDcX++ bbAtEwbeScRE08tnMO4iOIoqjidl5KrtsudjtjjKPQ8oQro9D3hmo6tFp+cVxfB3TodH h5HpKdzf/O284w8m8khxmKjRRs6hZcR607ZLOutrlSGn2m2ajinhuLCG90eNULn5X8F/ kaEngc+sDZbaisevMBPJdnyGj5uo8er8B5yQ36PGRQ63VfqMLrzFp4+/e1c19gVp2OmQ rfoA== X-Gm-Message-State: AOAM530wDrdLA4qNW+niljsOCkwCKQh2RWsnz8jaxOH2P79fnvsvdx5A 9A99U1A1vIiYPUErq7ic72w= X-Google-Smtp-Source: ABdhPJyTGQk9B96Nert4sfaJPfbF3+ZFCxu84YbxpO3V2AMO7yTCO/o0GN1ofBwNnh5Iw+ViMxWcxQ== X-Received: by 2002:a65:5c08:: with SMTP id u8mr28678333pgr.184.1596000121225; Tue, 28 Jul 2020 22:22:01 -0700 (PDT) Received: from software.domain.org (28.144.92.34.bc.googleusercontent.com. [34.92.144.28]) by smtp.gmail.com with ESMTPSA id l4sm739539pjr.46.2020.07.28.22.21.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2020 22:22:00 -0700 (PDT) From: Huacai Chen To: Thomas Bogendoerfer , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring Cc: linux-mips@vger.kernel.org, Fuxin Zhang , Huacai Chen , Jiaxun Yang , Huacai Chen Subject: [PATCH 4/5] irqchip: loongson-htvec: Support 8 groups of HT vectors Date: Wed, 29 Jul 2020 13:22:09 +0800 Message-Id: <1596000130-8689-4-git-send-email-chenhc@lemote.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1596000130-8689-1-git-send-email-chenhc@lemote.com> References: <1596000130-8689-1-git-send-email-chenhc@lemote.com> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org The original version can only used by old Loongson-3 which only use 4 groups of HT vectors. Now Loongson-3A R4 can use 8 groups, so improve the driver to support all 8 groups. Signed-off-by: Huacai Chen Reviewed-by: Jiaxun Yang --- drivers/irqchip/irq-loongson-htvec.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/irqchip/irq-loongson-htvec.c b/drivers/irqchip/irq-loongson-htvec.c index 1ece933..e7722fa 100644 --- a/drivers/irqchip/irq-loongson-htvec.c +++ b/drivers/irqchip/irq-loongson-htvec.c @@ -19,15 +19,14 @@ /* Registers */ #define HTVEC_EN_OFF 0x20 -#define HTVEC_MAX_PARENT_IRQ 4 +#define HTVEC_MAX_PARENT_IRQ 8 #define VEC_COUNT_PER_REG 32 -#define VEC_REG_COUNT 4 -#define VEC_COUNT (VEC_COUNT_PER_REG * VEC_REG_COUNT) #define VEC_REG_IDX(irq_id) ((irq_id) / VEC_COUNT_PER_REG) #define VEC_REG_BIT(irq_id) ((irq_id) % VEC_COUNT_PER_REG) struct htvec { + int num_parents; void __iomem *base; struct irq_domain *htvec_domain; raw_spinlock_t htvec_lock; @@ -43,7 +42,7 @@ static void htvec_irq_dispatch(struct irq_desc *desc) chained_irq_enter(chip, desc); - for (i = 0; i < VEC_REG_COUNT; i++) { + for (i = 0; i < priv->num_parents; i++) { pending = readl(priv->base + 4 * i); while (pending) { int bit = __ffs(pending); @@ -147,7 +146,7 @@ static void htvec_reset(struct htvec *priv) u32 idx; /* Clear IRQ cause registers, mask all interrupts */ - for (idx = 0; idx < VEC_REG_COUNT; idx++) { + for (idx = 0; idx < priv->num_parents; idx++) { writel_relaxed(0x0, priv->base + HTVEC_EN_OFF + 4 * idx); writel_relaxed(0xFFFFFFFF, priv->base); } @@ -157,7 +156,7 @@ static int htvec_of_init(struct device_node *node, struct device_node *parent) { struct htvec *priv; - int err, parent_irq[4], num_parents = 0, i; + int err, parent_irq[8], i; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) @@ -176,19 +175,18 @@ static int htvec_of_init(struct device_node *node, if (parent_irq[i] <= 0) break; - num_parents++; + priv->num_parents++; } - if (!num_parents) { + if (!priv->num_parents) { pr_err("Failed to get parent irqs\n"); err = -ENODEV; goto iounmap_base; } priv->htvec_domain = irq_domain_create_linear(of_node_to_fwnode(node), - VEC_COUNT, - &htvec_domain_ops, - priv); + (VEC_COUNT_PER_REG * priv->num_parents), + &htvec_domain_ops, priv); if (!priv->htvec_domain) { pr_err("Failed to create IRQ domain\n"); err = -ENOMEM; @@ -197,7 +195,7 @@ static int htvec_of_init(struct device_node *node, htvec_reset(priv); - for (i = 0; i < num_parents; i++) + for (i = 0; i < priv->num_parents; i++) irq_set_chained_handler_and_data(parent_irq[i], htvec_irq_dispatch, priv); From patchwork Wed Jul 29 05:22:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 11690367 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5086313B1 for ; Wed, 29 Jul 2020 05:22:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36F0E2070B for ; Wed, 29 Jul 2020 05:22:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rjJLGETb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726208AbgG2FWm (ORCPT ); Wed, 29 Jul 2020 01:22:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgG2FWl (ORCPT ); Wed, 29 Jul 2020 01:22:41 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3DCFC061794 for ; Tue, 28 Jul 2020 22:22:41 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id i92so1035310pje.0 for ; Tue, 28 Jul 2020 22:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=vi7gMuiWnBMUuvMOxjT9185yHGQJrgjWLrG3SUOb0FM=; b=rjJLGETbIcGisb38BEKZhIzbr08BtcB6SojJYp95jXzk3PnjBNns4iqro5SSGGhOkc q8vs+dIbAJRwgfAPBF4htEevoZy6EzbvL1ViPXz/NsHQaK/nGE3tRrzo/ApV0ouKu6M9 ZpQ7OERYTwHooNdvfT1rlyTBGWFjPZhwhBlqE2pRvjlUNks3Se8O5e0FCYRSocAZy/py pRrXJDTWYsdHrGg1RPjPW0aJQZjLyFvL4+6DJ0nDWhhhGKFWSvJX2q35OtPwYg5EQxRY ZIKDzsLwkbnP2/p7qqYSn5I2w8Zj3fDF9pQI5shfWzPANOtEDgpvBZoeYUc4PcxVy9ZB CYDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=vi7gMuiWnBMUuvMOxjT9185yHGQJrgjWLrG3SUOb0FM=; b=gJfDC90xp/ebZNy1QQgJ3BpKzxwS6sRZCx/DNixzabHZBFYpymfwWkeM/Xsusp3N2e EEMOxQhgx+93kRorASLdn3+cdnUOfNygNgvKGchdKbESzYg4Ugxe6xyl++oxZ8kmfYam IObQPeOJGNBq7op6K/mbLidcxH9k3d8zBWI0CBi/I7gFiptiXeMRX9R9WXKk963rYkuA yOlRFIwGUCOj5jM3+RbKnX/BHhumxJPEp9jj5zLYeNMV5JaMw/7qCCsImxVTblY/uqj+ JUnK/AR/43iUn1UqgpKEybzzOzaZn7hdzyhMonwufXJL4Xq0B/MxeBG5rIMCLNWUlN8a EqTw== X-Gm-Message-State: AOAM531AdwkYCwzsRAcxgKruMZ3FacymtgbujZpzZOivSNUT5Ot8TMNN xAC+/1F+I270qDHKVJtWfY0= X-Google-Smtp-Source: ABdhPJxfplVPtwA1ozoHkWKAU1NedGjSwKjFCygFM2CDjkHoSGYhuRAZ/7yE+ATJ2hyY/+RI+zMDdw== X-Received: by 2002:a17:90b:353:: with SMTP id fh19mr7966357pjb.196.1596000161234; Tue, 28 Jul 2020 22:22:41 -0700 (PDT) Received: from software.domain.org (28.144.92.34.bc.googleusercontent.com. [34.92.144.28]) by smtp.gmail.com with ESMTPSA id l4sm739539pjr.46.2020.07.28.22.22.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2020 22:22:40 -0700 (PDT) From: Huacai Chen To: Thomas Bogendoerfer , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring Cc: linux-mips@vger.kernel.org, Fuxin Zhang , Huacai Chen , Jiaxun Yang , Huacai Chen Subject: [PATCH 5/5] irqchip: loongson-pch-pic: Fix the misused irq flow handler Date: Wed, 29 Jul 2020 13:22:10 +0800 Message-Id: <1596000130-8689-5-git-send-email-chenhc@lemote.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1596000130-8689-1-git-send-email-chenhc@lemote.com> References: <1596000130-8689-1-git-send-email-chenhc@lemote.com> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Loongson PCH PIC is a standard level triggered PIC, and it need to clear interrupt during unmask. Signed-off-by: Huacai Chen Tested-by: Jiaxun Yang --- drivers/irqchip/irq-loongson-pch-pic.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index 2a05b93..61d06df 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -64,15 +64,6 @@ static void pch_pic_bitclr(struct pch_pic *priv, int offset, int bit) raw_spin_unlock(&priv->pic_lock); } -static void pch_pic_eoi_irq(struct irq_data *d) -{ - u32 idx = PIC_REG_IDX(d->hwirq); - struct pch_pic *priv = irq_data_get_irq_chip_data(d); - - writel(BIT(PIC_REG_BIT(d->hwirq)), - priv->base + PCH_PIC_CLR + idx * 4); -} - static void pch_pic_mask_irq(struct irq_data *d) { struct pch_pic *priv = irq_data_get_irq_chip_data(d); @@ -85,6 +76,9 @@ static void pch_pic_unmask_irq(struct irq_data *d) { struct pch_pic *priv = irq_data_get_irq_chip_data(d); + writel(BIT(PIC_REG_BIT(d->hwirq)), + priv->base + PCH_PIC_CLR + PIC_REG_IDX(d->hwirq) * 4); + irq_chip_unmask_parent(d); pch_pic_bitclr(priv, PCH_PIC_MASK, d->hwirq); } @@ -124,7 +118,6 @@ static struct irq_chip pch_pic_irq_chip = { .irq_mask = pch_pic_mask_irq, .irq_unmask = pch_pic_unmask_irq, .irq_ack = irq_chip_ack_parent, - .irq_eoi = pch_pic_eoi_irq, .irq_set_affinity = irq_chip_set_affinity_parent, .irq_set_type = pch_pic_set_type, }; @@ -150,7 +143,7 @@ static int pch_pic_alloc(struct irq_domain *domain, unsigned int virq, irq_domain_set_info(domain, virq, hwirq, &pch_pic_irq_chip, priv, - handle_fasteoi_ack_irq, NULL, NULL); + handle_level_irq, NULL, NULL); irq_set_probe(virq); return 0;