From nobody Mon Feb 9 19:05:39 2026 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 37D69143878; Wed, 24 Apr 2024 20:04:14 +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=1713989055; cv=none; b=dQwK1bnIGPxE7WBLJoJ4WMtv5Sn9Z8NpuGd5Dit8qR3f5c08bkvYJ0yrwt3t9cCfwLNRR0y2lGEF+4Zwt3AauK+sKgUOgA07lpjCDyaNlQMFMGmm1PT0Wqzbo67F3r2Ng5b5AUo5wHiyC2C91GTrx5aHD2ypcC8dgTJXEoVssT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713989055; c=relaxed/simple; bh=evdbgZzDIIuQPOxc6b5ueItS9nng/hH/QWa/LXIXMlU=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=rZxKwN/WKEJ3Ni18qWjsXJ5vE0h0NK31ZP/TfjV2SLgXsaExupjeFacQM5UX4I8noaCLbGMkMOhgx4dojIQREpwZwdaxdkRe7okuIvSYex0Ca1flTvpgb/dyd+THlclULyNvopVj+zY2kc+9dpeBAFF26sF1CX0yCwu+QCGb28w= 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=4oHNXR2f; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hECedFK/; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4oHNXR2f"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hECedFK/" Date: Wed, 24 Apr 2024 20:04:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1713989047; 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=g31eNiIar8EHGpPwJvz0j6LutnAx2RKP5X0CxYEOyuw=; b=4oHNXR2f8n9Rs3GxXiH4jcATSP+Js6vHbuNbS1nQFMk9Oo5F09p6FrVaPUEYcGoE+1lDpX 0PPS2O7sn1QilFOqiPW5P3RgI1ayKZpPPxUC9yUprJLO/EgP5rQQSVRuGYj1gdYZIiEMvr sc7+YSK/Qjl5LU3fe8HigFY0HDJZOQ6egXkcMe4smduEihxslczydQb3ACAH4kLa/CCl/d G2Bz2Ec0I0CrOVQgr9k8tTkf1zpyrKQfR4MrkO2UvNwX6yeeTQQ2gP+yfcfozLBtlSgAKB KCaQuOoy9GE9LEdE6aS1gS7keOE6MBLtJW6ggYcdTI0YxVuk6ze2qmEQcXJ6Qg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713989047; 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=g31eNiIar8EHGpPwJvz0j6LutnAx2RKP5X0CxYEOyuw=; b=hECedFK/PE5X5ZHTH843ySnGauT5oWPUBB/gEULuuu0PzonQBGIabtI3W9l79ytiakdSW6 dW8uSTlJZ+ug0PBQ== From: "tip-bot2 for Florian Fainelli" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/irq-brcmstb-l2: Avoid saving mask on shutdown Cc: Tim Ross , Florian Fainelli , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20240424175732.1526531-1-florian.fainelli@broadcom.com> References: <20240424175732.1526531-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171398904763.10875.14850183549093538755.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/core branch of tip: Commit-ID: c7cad38d37486668a448215fc92bace9c8cf747a Gitweb: https://git.kernel.org/tip/c7cad38d37486668a448215fc92bace9c= 8cf747a Author: Florian Fainelli AuthorDate: Wed, 24 Apr 2024 10:57:32 -07:00 Committer: Thomas Gleixner CommitterDate: Wed, 24 Apr 2024 21:11:48 +02:00 irqchip/irq-brcmstb-l2: Avoid saving mask on shutdown The interrupt controller shutdown path does not need to save the mask of enabled interrupts because the next state the system is going to be in is akin to a cold boot, or a kexec'd kernel. Saving the mask only makes sense if the software state needs to preserve the hardware state across a system suspend/resume cycle. As an optimization, and given that there are systems with dozens of such interrupt controller, save a "slow" memory mapped I/O read in the shutdown path where no saving/restoring is required. Reported-by: Tim Ross Signed-off-by: Florian Fainelli Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240424175732.1526531-1-florian.fainelli@b= roadcom.com --- drivers/irqchip/irq-brcmstb-l2.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb= -l2.c index 2b0b317..c988886 100644 --- a/drivers/irqchip/irq-brcmstb-l2.c +++ b/drivers/irqchip/irq-brcmstb-l2.c @@ -118,7 +118,7 @@ out: chained_irq_exit(chip, desc); } =20 -static void brcmstb_l2_intc_suspend(struct irq_data *d) +static void __brcmstb_l2_intc_suspend(struct irq_data *d, bool save) { struct irq_chip_generic *gc =3D irq_data_get_irq_chip_data(d); struct irq_chip_type *ct =3D irq_data_get_chip_type(d); @@ -127,7 +127,8 @@ static void brcmstb_l2_intc_suspend(struct irq_data *d) =20 irq_gc_lock_irqsave(gc, flags); /* Save the current mask */ - b->saved_mask =3D irq_reg_readl(gc, ct->regs.mask); + if (save) + b->saved_mask =3D irq_reg_readl(gc, ct->regs.mask); =20 if (b->can_wake) { /* Program the wakeup mask */ @@ -137,6 +138,16 @@ static void brcmstb_l2_intc_suspend(struct irq_data *d) irq_gc_unlock_irqrestore(gc, flags); } =20 +static void brcmstb_l2_intc_shutdown(struct irq_data *d) +{ + __brcmstb_l2_intc_suspend(d, false); +} + +static void brcmstb_l2_intc_suspend(struct irq_data *d) +{ + __brcmstb_l2_intc_suspend(d, true); +} + static void brcmstb_l2_intc_resume(struct irq_data *d) { struct irq_chip_generic *gc =3D irq_data_get_irq_chip_data(d); @@ -252,7 +263,7 @@ static int __init brcmstb_l2_intc_of_init(struct device= _node *np, =20 ct->chip.irq_suspend =3D brcmstb_l2_intc_suspend; ct->chip.irq_resume =3D brcmstb_l2_intc_resume; - ct->chip.irq_pm_shutdown =3D brcmstb_l2_intc_suspend; + ct->chip.irq_pm_shutdown =3D brcmstb_l2_intc_shutdown; =20 if (data->can_wake) { /* This IRQ chip can wake the system, set all child interrupts