Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp232351lqb; Tue, 16 Apr 2024 14:06:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrQzwlaw98v/44FoYUpSMrjahuuFE2bfjZoE9qQf2IaYwECcnMY5/zIyCK9FgaO6Jt2Ohud5HZkD89Z8FRM2SGIamqwjWMtIkc0DJO1A== X-Google-Smtp-Source: AGHT+IGk6lpLKxEio3NPtbUpPflPAwt2b6zRH0FAxakaeOCquL7bF7aJ3wnX0z/Z1Kv07j/Ri5uR X-Received: by 2002:a17:903:124e:b0:1e4:200e:9c2b with SMTP id u14-20020a170903124e00b001e4200e9c2bmr13802859plh.21.1713301586961; Tue, 16 Apr 2024 14:06:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713301586; cv=pass; d=google.com; s=arc-20160816; b=DNXeWadPKc4qLixPij6uyvDbPgX6EMihUkwVA9ui2xIjretWAESXAYSsSGj9JzmThh TrV4AzQpl1B/XgLcncYWdVngdGwE6zkfRYTVFBU+Uf7Oj9YK/EfmawwkOhEDriLafFJK oDSbpyDaWcT0Ug0czK/ZlUCQxdNE+WIfWnh3xa9pqqGDGs1lrTv0n+jAU/JVz+jGmkHD 80mKCbKI/6cl0LC0mPecnblU7O1CJXDmYJg7xbaX4tW5Lyn8gFoxgqSZpklGGzgvDQK5 OMSPuQ5qPIsc/iVc4QCxFf+BOFcNR2r0RUZ3YzQfv+6GrkNvdJfxfz93fXADAUHwOLRy lvHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=E8yX8K/NGSUmgNuLNyuWWu0UtLRH4oGRM/tKSlRN6Iw=; fh=SR2WsHnZCyoALY6BHkQ97Y9w3V9mdDESHAsYCgmL0jU=; b=mipVWK3iF8ngF3qxq/bVN2LiPt5u1Va2AlWJnam7+j3Uy0H8RNt58gNjGEgSDbals2 EgZFGru5r4liUhlk3Eg8strKGsm7tZ5LsoXXfIoxjC+j+/EJXZMXcpBXoKIIadrBTvOA 0lxt7z08rmMSwSqGxjP2vrAWMIzG6A6oj1kDvS26CIhQsMoFIX4PycxsW7mkjUjIjm9v LwNuwaQWFxcgV1gVwcXJmdu4ovIkAtDHQJ8e9/pOaEf3MPbRUmaddjCiAz5ys4ArLTWD xJFf0PAY3DhYyWtoZ+8dmYybZGvTuSkTzkAl9gtTtQ85e/VPE/xvSiMSjOmbSoCsVsvN nMEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=MIPC4Cde; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-147484-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147484-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y11-20020a17090322cb00b001e4638cbd46si10245038plg.420.2024.04.16.14.06.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 14:06:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147484-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=MIPC4Cde; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-147484-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147484-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com 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 ADBF0B21CD8 for ; Tue, 16 Apr 2024 19:49:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2221D13956C; Tue, 16 Apr 2024 19:49:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="MIPC4Cde" Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.207]) (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 DFC361386A8; Tue, 16 Apr 2024 19:49:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.207 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713296961; cv=none; b=nBnEy6Dxvp3/+U2XNMvCGnHcaxZwvKIIZ2/+968yYXTGzpt5RxLpJc/vzqK8/KxVXtNtUnBPm6QoRrXmZruA06aDyNWIBuYXxVKPmnfhJ8A4jCyjLBtbON1+6tzq6iB4IStQw+L9SDvaXY/S+hLM42oQLDpcSMyB8ZlF4n1bF3I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713296961; c=relaxed/simple; bh=9lZXQQb2otPcrvmQIRJEDc1staJ0Dw4ScCLzO4hLTAw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=qmgBEb+bMMfOi19DFRMDBqYgHnVnVu0TOws27cdv7ZOxjwsgBdB3t+ZmlONWU/SajXYPc33lL54yqA7H5P0nrNoqXiVnph+YmpXltHau8p//40RwCL4ZhUCRBBYYkfbj4tPo4GaIx54n5Sr51P/nUHO4opUNwW1wWa8CViEFcOQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=MIPC4Cde; arc=none smtp.client-ip=192.19.144.207 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id BC5CBC0000F3; Tue, 16 Apr 2024 12:43:51 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com BC5CBC0000F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1713296631; bh=9lZXQQb2otPcrvmQIRJEDc1staJ0Dw4ScCLzO4hLTAw=; h=From:To:Cc:Subject:Date:From; b=MIPC4Cdeho+xCKH8H/m1aVuXOX5OIg0PcZVQq44xwUMWCbiGRcMmKroyi49tdAbDN m1gUsoa7pAta2ZyE5vG7CfFcwxhb3nH52YMexj5PtCrYGOZgFZUsZut9zg2p3qFcZG ptnpw1FK/Zskg7wKq6teGEj3CsM0UuoSy9qCQjnc= Received: from fainelli-desktop.igp.broadcom.net (fainelli-desktop.dhcp.broadcom.net [10.67.48.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id DD7A318041CAC4; Tue, 16 Apr 2024 12:43:49 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: opendmb@gmail.com, Florian Fainelli , Tim Ross , Broadcom internal kernel review list , Thomas Gleixner , linux-mips@vger.kernel.org (open list:BROADCOM BMIPS MIPS ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE) Subject: [PATCH] irqchip/irq-brcmstb-l2: Avoid saving mask on shutdown Date: Tue, 16 Apr 2024 12:43:42 -0700 Message-Id: <20240416194343.469318-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Reported-by: Tim Ross Signed-off-by: Florian Fainelli --- 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 2b0b3175cea0..c988886917f7 100644 --- a/drivers/irqchip/irq-brcmstb-l2.c +++ b/drivers/irqchip/irq-brcmstb-l2.c @@ -118,7 +118,7 @@ static void brcmstb_l2_intc_irq_handle(struct irq_desc *desc) 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 -- 2.34.1