Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1252205pxa; Thu, 20 Aug 2020 06:49:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwpQoRCDtmrMA38X5fUUDNkRUsDsV01XRxAOpIEr0s0coyo/bFhCdhrMT4HsdfEwCAvhFB X-Received: by 2002:a17:906:7e0b:: with SMTP id e11mr3526713ejr.540.1597931367376; Thu, 20 Aug 2020 06:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931367; cv=none; d=google.com; s=arc-20160816; b=ZtS7vgiFit+VgMPnBEaiAEs6Cu71z0q3pL2FoEMSHyyREX9wZ6WfpJRuzwCfFT9QlZ Qfrp7jNWlFRc1P3p7XvABanh3wTvzU8+cxrvUynGYfw1mQc0NE04fJpztJ5fPVONmWOQ 26iQ5pTE6kucLIXNNPNAJVvA2k6dck9M7DJOnpGcj4Je5hNNPqmJ5HH+OIpoz2MmRdad pisgDoYauk0MD2veETLgcmaMWu318x+FA98JkMdXkAMwlBcScUU+N/SKaTmeB/HclWuA BhmuiHcdKXChAXcCCnv/4LSDpgLI6uZSgwsNkr80iQGJZ23+Ln/xSkXKSQw48/MYfMHS 7YQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NhC/Ork3MbRxN1cc/6TpOZXI3QOHuNUUoLDqH3lLV7g=; b=seWVL8xSSgqrZ82WgX2JKqCHwd7wJqX4u9NJnn8cs2Vo5J9M8pKd+POMGG2+j4E7B2 eY9UChkDxo3gxy5y5h5oGisPn/CTnGqNjWNhutFypwcLJ3xum4yjrw7EsO5fVm9F2RMD NKVTsLbZMFtDxX0WK9nc7/4LYf368liFpe+1otZ1+nZQmaWh1h0PnvHOaUYU6haKOkKi e3D6bgA51wtkgKELBx+GUEi2JcZftaIL/xE1DUQxwJaDjGph/OyrezUzqlHBgxo/CXqI /TFBdPM9JODuiNR8WmDYS2y/JjsLu2MhxiS5IFq8QlNakbvyQpzHCq6xhtUYj08F5CzI 9ekg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kIylcYC0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si1332513edr.523.2020.08.20.06.49.03; Thu, 20 Aug 2020 06:49:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kIylcYC0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729523AbgHTNpk (ORCPT + 99 others); Thu, 20 Aug 2020 09:45:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:37886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727031AbgHTJ2E (ORCPT ); Thu, 20 Aug 2020 05:28:04 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F017522D2A; Thu, 20 Aug 2020 09:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915683; bh=ov1CrJpVQeLLIsOKM+hyYHl1kAdRmAxP2gMG4EbotJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kIylcYC0/btL0GZmefYETxKB9CtLcabqCTLlNmEe3kdEebCvUl+Zft1L7efRJZtzM klI2O1Ry/rDVNwcRDalqjofrs6QL3J/spC/GG4mdKeuv8IzAYnO2skZfSGrtGH5Nh8 sgxrsvyulasPIusLcbdq8SASvP2JI8AU6/FJEyiE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huacai Chen , Marc Zyngier , Jiaxun Yang Subject: [PATCH 5.8 059/232] irqchip/loongson-liointc: Fix misuse of gc->mask_cache Date: Thu, 20 Aug 2020 11:18:30 +0200 Message-Id: <20200820091615.649467700@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huacai Chen commit c9c73a05413ea4a465cae1cb3593b01b190a233f upstream. 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. Fixes: dbb152267908c4b2c3639492a ("irqchip: Add driver for Loongson I/O Local Interrupt Controller") Signed-off-by: Huacai Chen Signed-off-by: Marc Zyngier Reviewed-by: Jiaxun Yang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1596099090-23516-4-git-send-email-chenhc@lemote.com Signed-off-by: Greg Kroah-Hartman --- drivers/irqchip/irq-loongson-liointc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -60,7 +60,7 @@ static void liointc_chained_handle_irq(s 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 @@ -132,11 +132,11 @@ static void liointc_resume(struct irq_ch 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); } @@ -244,7 +244,7 @@ int __init liointc_of_init(struct device 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++) {