Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3904808pxb; Mon, 8 Feb 2021 03:10:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJz18jd2Xbie+UolAbRuyUhZ11LFbBL9i9tYn4XzcWSDGn18ojP8D167MJgHiUZV8rc2uQIM X-Received: by 2002:aa7:dd4c:: with SMTP id o12mr16161455edw.180.1612782638155; Mon, 08 Feb 2021 03:10:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612782638; cv=none; d=google.com; s=arc-20160816; b=bhSwN2OhsBfAe/9CTA/UzJrbnEXjaBuS+7M43N6DGGBMM2ETG98/y+bJlHP76KB7+g ggY+7oaKJ986IgLI09aWiqAFPSYuJwsvIhRvJ5wSSJxHoetBiq0bRN9eRPhH4nf8/WEw YvAcU6BlGgcxvK8T3usigBXwvFwX8QaPMb1gBmQj9opwEsQL6EEwozB19P5VP4ZbXQTq gJkHFSf3I2eayOt2kn09347TBcokd9mXOdiEzFcJp7F1oZlnkZJYdcLQbe0smaqbQLm/ mnqxtt2ZqCsR7RC5IYiBQCeUBeRHlafAp96o8h2qEAED1vk+aZoNWDpBwVVVYZ+lWfBM xwbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=WK3PNdzda9h0/AoLHZSnJuEB7hGhmeulSXHcBB0Zv1c=; b=WSxYlxcEE31yHtoPFHHvwev2aa9H5N0ZLFxGi8BDH9omhcQm9V1FEUbrVAzAPX5ut9 IhxQ/+tkjjJRMSBsXMWe+nn9KtRszLDmdsKqduepVlbqKrj4xpy5bawpeM60+RphC/yF 3lGkwk5eR2K6ZMiMiRkqSmjLJTVMyQKkWnT9VuZrnx27lR3Ngawgj/EebtH2cpBeNzOv TIVcPqQN4ofT1O6JlM6P3NZKF8QAn3OysB2RXDgJ8UmZQPezo1NBsnhn6L+dCvhbPBYI WjI0A3F6WHA2ppnfSvnXFMbHn5A7Dsg1OV5RnyuSIGxZmbQO3J05rydBgDu5hXD2LVch +5og== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr3si11322014ejc.380.2021.02.08.03.10.14; Mon, 08 Feb 2021 03:10:38 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232694AbhBHLJW (ORCPT + 99 others); Mon, 8 Feb 2021 06:09:22 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:12870 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232825AbhBHLAK (ORCPT ); Mon, 8 Feb 2021 06:00:10 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DZ3012Flwz7hqv; Mon, 8 Feb 2021 18:57:53 +0800 (CST) Received: from huawei.com (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Mon, 8 Feb 2021 18:59:11 +0800 From: Luo Jiaxing To: CC: , , Subject: [PATCH v1 1/2] irqchip/gic-v3-its: don't set bitmap for LPI which user didn't allocate Date: Mon, 8 Feb 2021 18:58:45 +0800 Message-ID: <1612781926-56206-2-git-send-email-luojiaxing@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612781926-56206-1-git-send-email-luojiaxing@huawei.com> References: <1612781926-56206-1-git-send-email-luojiaxing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver sets the LPI bitmap of device based on get_count_order(nvecs). This means that when the number of LPI interrupts does not meet the power of two, redundant bits are set in the LPI bitmap. However, when free interrupt, these redundant bits is not cleared. As a result, device will fails to allocate the same numbers of interrupts next time. Therefore, clear the redundant bits set in LPI bitmap. Fixes: 4615fbc3788d ("genirq/irqdomain: Don't try to free an interrupt that has no mapping") Signed-off-by: Luo Jiaxing --- drivers/irqchip/irq-gic-v3-its.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index ed46e60..027f7ef 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3435,6 +3435,10 @@ static int its_alloc_device_irq(struct its_device *dev, int nvecs, irq_hw_number *hwirq = dev->event_map.lpi_base + idx; + bitmap_clear(dev->event_map.lpi_map, + idx + nvecs, + roundup_pow_of_two(nvecs) - nvecs); + return 0; } -- 2.7.4