From patchwork Tue Feb 13 09:57:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 200342 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp442058dyb; Tue, 13 Feb 2024 02:20:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWaovx1XM8Qkx8YbmuewBbCmqWaCjhK8XpgZ9A/KguAU+vsdB5f8Wp0PmqqWEEWNvvpx1yOU38Yo3XUneZnnEAzdB7eng== X-Google-Smtp-Source: AGHT+IG2ODG+qV8Iiog3rxkdNlKZBnpkF95qYOizurJKuK7rW95ngbtbK+5nTsIbpv6uGfo8zrTn X-Received: by 2002:a05:6870:5492:b0:210:b468:6a60 with SMTP id f18-20020a056870549200b00210b4686a60mr12022375oan.32.1707819599932; Tue, 13 Feb 2024 02:19:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819599; cv=pass; d=google.com; s=arc-20160816; b=XDZJlDqUQTRDhrQq7CQ/ihdsjixp4bH0qSn1lwpg+sN0K86QJ30KhJRM0UWV/wqVI+ 6C8PiykeMyj3fKg/6Mlj1wurJcaKZtMky11UpXGeW51fy1qAmutlqdGJAqk2IGlTzPnQ 9J2d4KzIgouCAcYEUOr9MXr+DwHdm8lAgX64pZCPPoEqZqpKw4/Ghtphl6UKBfy+sN3o gWpXDp8d0v4wCY78ofOVbaH+kUphBJnTU9/AxpJxGeufylUOsOVdlmiTOvB2XXJLINyA jqJ/0vPCWLT8T34mKucSMmYBzfNzQBLgUaUE85rkg1rOg1aerDLTPuPQEVnS5eNeMB8g lRng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=ViPAHRtvPOjXBMZBHTrl44RxxnL8Z+bRUcZYuXKYh3c=; fh=jB6/5SvKuD8978Of8DyyGsVf9FpUB/lFrxwA4n1RDwM=; b=yMpKFCAPhlCMiEi+IvzgGLj5AWrmY1nFQveOx6sw9NBEUD2IFjSfkmQ+FEddwXPi67 jypoWbfJtY3bQbowkVGA29CstvopTTLuomY1KoQec0olASq9ouAhKGygaYYviUooFyws b3pR512tDDiYPE3DTlbOirAjCLluGE8yOBVW2av4VaalKfsxZO48HBHXepH50ndIcXVe 9AOezVQPV1YxNUbB2utv/YaFrb45ZQbKyU/CLxBsucntPvlb2ZawHTZX8Anm6z8KNUGk jjkFumTkPlo0V2vSDzVVNCvG0NddFvZ2natzqYEwp9C0gIWBgrqVZITwOKDx+lwTH+u5 iuSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=c9WEYjzL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-63284-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63284-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCXO5jzzyE/SnxJojgmfsj1WsD5i/GnHoafIpOCrDGna6C/DdqHx9ojhFTvRUyUUKCEMflnnDPdC0+p+alSlDPaPWJFNzg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p19-20020a637f53000000b005dc4827d5bdsi1828406pgn.546.2024.02.13.02.19.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:19:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63284-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=c9WEYjzL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-63284-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63284-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D2E57B28DBB for ; Tue, 13 Feb 2024 09:59:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BC6038DEC; Tue, 13 Feb 2024 09:57:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="c9WEYjzL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="udrctsrV" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9E862C69A; Tue, 13 Feb 2024 09:57:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818224; cv=none; b=AqyLV/4NypOBYvf+7o+rBj7y1+ev1W7hDmw10YLOqubNMhyTCOAtJxgcaugnROelND0sJFH5jCvd644+TDCyA4ZA+oC4lZ2+3W/ZoptxcY1i4jI6XZ4UZbiE9zUP+B4N0pXzGbqEGuBuP5BtKXQQTXXBN6fKJ1sCCzE0IIVPNNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818224; c=relaxed/simple; bh=DT5Oz0ddq0A6814n/Id9rTOGVREUufiivj3OBaXGdwg=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=C54+0n9Y3zq+HnkUAfN4ZZKAKm43mcf8AcymES1JSdZFFek2gXLvrSpH6qQRX9VVtJGDSRXAbdB2eDHuQyIr7StQS8twuBIqUjLGLB4gvis3ZKtWKd/HKwEsX0Pip7MTV02Z60qXrrw+F2BrubBcALGA8KwUT83K0biFt8xqsXM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=c9WEYjzL; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=udrctsrV; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 13 Feb 2024 09:57:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707818221; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ViPAHRtvPOjXBMZBHTrl44RxxnL8Z+bRUcZYuXKYh3c=; b=c9WEYjzLrW1EhVSnslpl+dsZC6Gf5bFH0ZlVCgeUcv0CPQVzgbnVu7eHiYePIuNoJIF+bF FHoVhpAtbe/PZski91pHMUOdCYnU/Z30EhFtTmv+SJqN85U0eF0KiROHrPiGcWZ8ibOGJ7 YvEZS1h5STnAfjsCUkotDZ69yqLgtfI/Xgvs9Dacj07xOXsfhf3/++TuvZUJWqneWSPh8Z mfyF6RAVfYu9Tc7p4czcbm6kRbmSkuylQgPn5Vl722HPdB25aJ5eRzWlp6WVnBrUwTms03 w9wrLhDWfSLuneBYQ2e8JSewK/0qUj7io9wG0V1sbwH6W6YSsem/RCi3ioN6Qw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707818221; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ViPAHRtvPOjXBMZBHTrl44RxxnL8Z+bRUcZYuXKYh3c=; b=udrctsrVdbozIsKP3X2QbVvKvoY/FiDCL4uP9e5NcKPwFeJN4qwJxADXN6+FTZLXgKqmaY bua9M08B+udNuEBw== From: "tip-bot2 for Bibo Mao" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/loongson-eiointc: Skip handling if there is no pending interrupt Cc: Bibo Mao , Thomas Gleixner , Huacai Chen , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20240130082722.2912576-3-maobibo@loongson.cn> References: <20240130082722.2912576-3-maobibo@loongson.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170781822030.398.1776508583120983829.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790778644908205714 X-GMAIL-MSGID: 1790778644908205714 The following commit has been merged into the irq/core branch of tip: Commit-ID: 3eece72ded7f67776731709702f3d1b9893b6a4f Gitweb: https://git.kernel.org/tip/3eece72ded7f67776731709702f3d1b9893b6a4f Author: Bibo Mao AuthorDate: Tue, 30 Jan 2024 16:27:21 +08:00 Committer: Thomas Gleixner CommitterDate: Tue, 13 Feb 2024 10:53:14 +01:00 irqchip/loongson-eiointc: Skip handling if there is no pending interrupt eiointc_irq_dispatch() iterates over the pending bit registers of the interrupt controller and evaluates the result even if there is no interrupt pending in a particular 64bit chunk. Skip handling and especially the pointless write back for clearing the non-pending bits if a chunk is empty. [ tglx: Massaged changelog ] Signed-off-by: Bibo Mao Signed-off-by: Thomas Gleixner Acked-by: Huacai Chen Link: https://lore.kernel.org/r/20240130082722.2912576-3-maobibo@loongson.cn --- drivers/irqchip/irq-loongson-eiointc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index 1623cd7..fad22e2 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -198,6 +198,12 @@ static void eiointc_irq_dispatch(struct irq_desc *desc) for (i = 0; i < eiointc_priv[0]->vec_count / VEC_COUNT_PER_REG; i++) { pending = iocsr_read64(EIOINTC_REG_ISR + (i << 3)); + + /* Skip handling if pending bitmap is zero */ + if (!pending) + continue; + + /* Clear the IRQs */ iocsr_write64(pending, EIOINTC_REG_ISR + (i << 3)); while (pending) { int bit = __ffs(pending);