Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp453258rwd; Sat, 20 May 2023 00:20:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5hoCgXEzsq6YVOVS+Tq1GZpzNIzZ4kHUoSyhn1hFt9Vqw/9fQzR3OT8yscgzFQf2YdA70w X-Received: by 2002:a17:90b:1056:b0:252:94b5:36f1 with SMTP id gq22-20020a17090b105600b0025294b536f1mr4275130pjb.27.1684567225638; Sat, 20 May 2023 00:20:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684567225; cv=none; d=google.com; s=arc-20160816; b=XjdiFRDakuIilgsIAqZ/bl2Tzi1aEVDL6hXTP7IjOWTaEzYBDZpgFXLW4l+zuiiwQS ecaq1ESb0o9vZG0j6uMpa6NwOl8OqE6VrGbipom8DqAjW3XJGN17l7c5uj8XgLXA8vGh mn+E59++j2Xr5iDifHuAMwARCAkxmiHgjWnhGZ1QT8brTZ6MgQtkGhVzZbUy0wPQDK/C yZf+18VbWpBV3wY3GqS/hAjAINm3YldwTpPumKv4USR5ePLrOYsFWlGbL/m01+wohXvZ O3IIQQ71yKgZeM+YCiSWMiMNPd60X+sTs9LzbtZa0RtYvP+onRVoHMnMHL7IkPQRGgd1 zy3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LMnyA4eKqrlVUommlWfknYHOSxZ3YTr5cCzoyNBJtWM=; b=oq1RslJA0adQZKF3yY4VVx7OeClDUSutm1WJLhzroroUifO4NP4ddV7mfsX7qpv4Il 671AJ0TtYQcqs35yZfmbJ1rQeNifvxfqYDVidbsVFVxQ4lIc2HZoQ/8YmoMjMBuni9o7 myz4V+9hXkRe5ThIVdxam82Ec+P3/lsi5k19NvnAEnIRyRUDemOEVzNhFfKSGt2UAwo1 ZM+ehS6Ldzvp2xaAQF+CrvCGHogb0Ums1PwIaP0L3/w8M38uIIY9MtocMDYiOZiBK6ZM BWqqReKZqLbnB3xjcbXHeR1Oq9eBkxmePpgtqIDNygIA20cmGV5JwkxRNGJUKOtnkwWz dwgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a17090a640800b0024bf50a83e7si3077193pjj.174.2023.05.20.00.20.04; Sat, 20 May 2023 00:20:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230284AbjETGig (ORCPT + 99 others); Sat, 20 May 2023 02:38:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbjETGia (ORCPT ); Sat, 20 May 2023 02:38:30 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1D5C21AC; Fri, 19 May 2023 23:38:28 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.176]) by gateway (Coremail) with SMTP id _____8DxzOrkamhkB18KAA--.17949S3; Sat, 20 May 2023 14:38:28 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.176]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxFLXaamhkd1JrAA--.51105S5; Sat, 20 May 2023 14:38:27 +0800 (CST) From: Jianmin Lv To: Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Lorenzo Pieralisi , Jiaxun Yang , Huacai Chen , loongson-kernel@lists.loongnix.cn, stable@vger.kernel.org Subject: [PATCH V1 3/4] irqchip/loongson-liointc: Fix IRQ trigger polarity Date: Sat, 20 May 2023 14:38:17 +0800 Message-Id: <20230520063818.27208-4-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230520063818.27208-1-lvjianmin@loongson.cn> References: <20230520063818.27208-1-lvjianmin@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxFLXaamhkd1JrAA--.51105S5 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7Zw1rKF1ruw4xKr48Cr43GFg_yoW8Zw4fp3 yfC3Wktr4aqFyUW3WUKr48X3W3AwnIq39rKa13W345uFZ0kan5A34ruFZFvr1xKa48GF4a krWrGay5Way3uwUanT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bSxYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l n4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E 87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxV Aaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxY O2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGV WUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_ Xr0_Ar1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rV WUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4U JbIYCTnIWIevJa73UjIFyTuYvjxUcYiiDUUUU X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,RCVD_IN_SBL_CSS, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For IRQ controller INT_POLARITY regitser of Loongson-2K CPU series, '0' indicates high level or rising edge triggered IRQ, '1' indicates low level or falling edge triggered IRQ. For Loongson-3A CPU series, setting INT_POLARITY register is not supported and writting it has no effect. So trigger polarity setting shouled be fixed for Loongson-2K CPU series. Fixes: 17343d0b4039 ("irqchip/loongson-liointc: Support to set IRQ type for ACPI path") Cc: stable@vger.kernel.org Signed-off-by: Chong Qiao Signed-off-by: Jianmin Lv --- drivers/irqchip/irq-loongson-liointc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c index 8d00a9ad5b00..9a9c2bf048a3 100644 --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -116,19 +116,19 @@ static int liointc_set_type(struct irq_data *data, unsigned int type) switch (type) { case IRQ_TYPE_LEVEL_HIGH: liointc_set_bit(gc, LIOINTC_REG_INTC_EDGE, mask, false); - liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, true); + liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, false); break; case IRQ_TYPE_LEVEL_LOW: liointc_set_bit(gc, LIOINTC_REG_INTC_EDGE, mask, false); - liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, false); + liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, true); break; case IRQ_TYPE_EDGE_RISING: liointc_set_bit(gc, LIOINTC_REG_INTC_EDGE, mask, true); - liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, true); + liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, false); break; case IRQ_TYPE_EDGE_FALLING: liointc_set_bit(gc, LIOINTC_REG_INTC_EDGE, mask, true); - liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, false); + liointc_set_bit(gc, LIOINTC_REG_INTC_POL, mask, true); break; default: irq_gc_unlock_irqrestore(gc, flags); -- 2.31.1