From patchwork Wed Jun 14 11:59:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5ZCV5bu65rCR?= X-Patchwork-Id: 107927 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1199029vqr; Wed, 14 Jun 2023 05:13:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5yZCBUEMKFLy9Z/fP6GMN9NmeIh0awQWSgS0m4BXwl/WyptoyXi8gp37dTQn4kiHdtxLWp X-Received: by 2002:a05:6870:702:b0:1a6:d839:a9eb with SMTP id ea2-20020a056870070200b001a6d839a9ebmr1355425oab.41.1686744794976; Wed, 14 Jun 2023 05:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686744794; cv=none; d=google.com; s=arc-20160816; b=jnyvVjkZKDcuJXbgn7cpZVdOhF3nrEwVITHrGmAuhLRNYSL/IjpxC4nAWDQQ8pfTR0 srFISo873B1sdKi38I+/cPB2/6k6U1EGWeB2jGAZWxy2IM41RQn5THZCtkfACVeIbxtj 5mbVC3/aVWpyGsWiCNny+lglXlY9iY7V97tWZdVxUrhq6NgJQX31v1YS/n+hFzfq27rJ T3Ss2F9H+/HKUocY3HUmILlhQg2eXOjao+ifKaB4wtB2MnILHp+8IO8k47dVQAEvm+rI BHCuty4KUtShjiGtoaXYh91vDUcsi7oC2xApKO030gwzuKYB83ek0h5Ed70zTCTS4sn2 T2zA== 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=sv4QzJMpqF7+PhxtVdDCiZmwWlIgVocbkTUVjLr2clU=; b=T4hQd4RzJKvXzjf10qNFGcispDtpdoZC4N26UP727+4wHYyLsAMgFSzeNA2FO74hWc HB0zvGRVprNX6/EQg/YI4LMXfePAwr73ZCJQJpDiX9GAB7ZCsdTRooCy2j/17iyJynbc R4K/w+K7pr9zvFIuPT2ERBdKGCi4hfcQBxOm4vVaEMMu58kKiwiefmnGw4RJEEfw6B9i Lrmeu8dmfUz7Y2ikfE16s8Th1P7DrkLdwLe9qJMxwkIScgAfi4FQLfnefjb7tPdFYLC7 W9gy9VjZ9whapDv+0Sxl9bpUJ7HTicDdSOj/7j8XtXPc5L4FSmo47ZI1NoPnUHYUdIQ6 SHdA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a17090a4c8300b00233e301c780si12394452pjh.31.2023.06.14.05.13.01; Wed, 14 Jun 2023 05:13:14 -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 S243798AbjFNMAX (ORCPT + 99 others); Wed, 14 Jun 2023 08:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244428AbjFNL7w (ORCPT ); Wed, 14 Jun 2023 07:59:52 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 88DA92112; Wed, 14 Jun 2023 04:59:40 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.116]) by gateway (Coremail) with SMTP id _____8CxPuuqq4lkuh0FAA--.10924S3; Wed, 14 Jun 2023 19:59:38 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.116]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxNeSoq4lkzJMaAA--.10424S4; Wed, 14 Jun 2023 19:59:38 +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 , WANG Xuerui , loongson-kernel@lists.loongnix.cn, Liu Peibao , stable@vger.kernel.org Subject: [PATCH V3 2/5] irqchip/loongson-pch-pic: Fix potential incorrect hwirq assignment Date: Wed, 14 Jun 2023 19:59:33 +0800 Message-Id: <20230614115936.5950-3-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230614115936.5950-1-lvjianmin@loongson.cn> References: <20230614115936.5950-1-lvjianmin@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxNeSoq4lkzJMaAA--.10424S4 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBj93XoW7uF48ZrWxXFWfGr18JrW7Jrc_yoW8CFy8pF 4UCwsa9F4DAF1jyw1kWw4kW343Aa9xtFW7Ka1Syr97ur1kJ3sYkF1UZFyF9r1kAFWfAFWU ZFZI9ayY9F17AFXCm3ZEXasCq-sJn29KB7ZKAUJUUUU3529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUBFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1a6r1DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ GcCE3s1ln4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2 x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5 McIj6I8E87Iv67AKxVWxJVW8Jr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI4 8JMxkF7I0En4kS14v26r126r1DMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j 6r4UMxCIbckI1I0E14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwV AFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv2 0xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4 v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Cr0_Gr1UMIIF0xvEx4A2jsIEc7CjxVAF wI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07U65l8UUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768680110177706641?= X-GMAIL-MSGID: =?utf-8?q?1768680110177706641?= From: Liu Peibao In DeviceTree path, when ht_vec_base is not zero, the hwirq of PCH PIC will be assigned incorrectly. Because when pch_pic_domain_translate() adds the ht_vec_base to hwirq, the hwirq does not have the ht_vec_base subtracted when calling irq_domain_set_info(). The ht_vec_base is designed for the parent irq chip/domain of the PCH PIC. It seems not proper to deal this in callbacks of the PCH PIC domain and let's put this back like the initial commit ef8c01eb64ca ("irqchip: Add Loongson PCH PIC controller"). Fixes: bcdd75c596c8 ("irqchip/loongson-pch-pic: Add ACPI init support") Cc: stable@vger.kernel.org Reviewed-by: Huacai Chen Signed-off-by: Liu Peibao Signed-off-by: Jianmin Lv --- drivers/irqchip/irq-loongson-pch-pic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index 921c5c0190d1..93a71f66efeb 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -164,7 +164,7 @@ static int pch_pic_domain_translate(struct irq_domain *d, if (fwspec->param_count < 2) return -EINVAL; - *hwirq = fwspec->param[0] + priv->ht_vec_base; + *hwirq = fwspec->param[0]; *type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK; } else { if (fwspec->param_count < 1) @@ -196,7 +196,7 @@ static int pch_pic_alloc(struct irq_domain *domain, unsigned int virq, parent_fwspec.fwnode = domain->parent->fwnode; parent_fwspec.param_count = 1; - parent_fwspec.param[0] = hwirq; + parent_fwspec.param[0] = hwirq + priv->ht_vec_base; err = irq_domain_alloc_irqs_parent(domain, virq, 1, &parent_fwspec); if (err)