Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp664915lqd; Wed, 24 Apr 2024 13:05:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1GN0jhmF3DHEvqp4KmGxgbMpiR9LtVmZ6whxkP/O/mgGukWkOpFDiv7Ui7kqxdao0/qnE40AuNUWDjOsNAE5EuEkkS7aFPgMtXrLfQg== X-Google-Smtp-Source: AGHT+IG8xL9oRHSiXhK4spUihsjki0svgmdW4J7p2W4CK7puuYOV39ZWnR3mcS+B5lID21//vG4q X-Received: by 2002:a05:622a:1821:b0:431:3d52:ab42 with SMTP id t33-20020a05622a182100b004313d52ab42mr4956808qtc.46.1713989136465; Wed, 24 Apr 2024 13:05:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713989136; cv=pass; d=google.com; s=arc-20160816; b=K20HZPOPSUbxCoC8Nx4l/gk+FMBm5aTNONqdAsx0p5EIUIrTKUoKf92pAVkDIl41xI 76CSjF18LefjPCIZ3YeR7OOVG5eRcsHOBozUNmhB0TGROZdqD8OAkiZ43eaCKK85oOGq ioElNJD5gohxrbp+50H4loogmEHP3Vo9JDIqo2YPHdIWOHbXhS7SeHJ9AjAK8Lb0drDy yp/5ROAINE9CMHAcO9vbvwzpGTmDvqLd3dODo8J687nz1/0ebnXs8MRhuRmROqrq8vVo 1shzeV2BkGUM34bxx8lfNI1U80nUa5kslRP61HIz0Lf4CtNzGA1hUXybbQZDnfgecrsq mGLQ== 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=g31eNiIar8EHGpPwJvz0j6LutnAx2RKP5X0CxYEOyuw=; fh=b/8D2vxpG2HCDngq3T/AoEU55ofROCUajZ/mQ7MYZbc=; b=XYJWLjh/DENdSGpOyDR6/revQvzcFxkolfOXD0iXLsx1HFrDo9NeRFiucPQTYbc7xF ETzytnrGmsrDYzb1ln89VyU8K2QdlATI115F7enR0c7kbOYm3gXOtP+OcFuBolb7aXsl 2aiSahodpa8FYQVactt4vH58Isui420sFtCcgSoCLH1Q5zTc74QHskt10FyoWWSSq4nh AS4O+Ksga/5gOfJJVGB6RgRv2Tn1ixXR4rkNT8fS1QtGIrtp4mo4wwJYn1KfQFSHjGRh Ys394VRZHJFEgQZjsbnN6y/flTon/38s/EK+gpGB4xxBHativC681VsYihsb3E3TpoUl oDvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4oHNXR2f; 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-157648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k16-20020a05622a03d000b004377121c1dfsi15706105qtx.382.2024.04.24.13.05.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 13:05:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4oHNXR2f; 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-157648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157648-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3674D1C22D11 for ; Wed, 24 Apr 2024 20:05:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3856145324; Wed, 24 Apr 2024 20:04:16 +0000 (UTC) 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/" 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 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: 7bit The following commit has been merged into the irq/core branch of tip: Commit-ID: c7cad38d37486668a448215fc92bace9c8cf747a Gitweb: https://git.kernel.org/tip/c7cad38d37486668a448215fc92bace9c8cf747a 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@broadcom.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); } -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 = irq_data_get_irq_chip_data(d); struct irq_chip_type *ct = irq_data_get_chip_type(d); @@ -127,7 +127,8 @@ static void brcmstb_l2_intc_suspend(struct irq_data *d) irq_gc_lock_irqsave(gc, flags); /* Save the current mask */ - b->saved_mask = irq_reg_readl(gc, ct->regs.mask); + if (save) + b->saved_mask = irq_reg_readl(gc, ct->regs.mask); 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); } +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 = irq_data_get_irq_chip_data(d); @@ -252,7 +263,7 @@ static int __init brcmstb_l2_intc_of_init(struct device_node *np, ct->chip.irq_suspend = brcmstb_l2_intc_suspend; ct->chip.irq_resume = brcmstb_l2_intc_resume; - ct->chip.irq_pm_shutdown = brcmstb_l2_intc_suspend; + ct->chip.irq_pm_shutdown = brcmstb_l2_intc_shutdown; if (data->can_wake) { /* This IRQ chip can wake the system, set all child interrupts