Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3707700pxb; Mon, 24 Jan 2022 15:58:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhY6pXgTN6RMT3mS1lwf1u2B6353gF8sAhRmhkgRGcS0yuAE/0drz5Jze0c6K300RP4RuW X-Received: by 2002:a17:90a:ae15:: with SMTP id t21mr725055pjq.147.1643068700108; Mon, 24 Jan 2022 15:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068700; cv=none; d=google.com; s=arc-20160816; b=EveBTz2b79GgH8/kPhy0jbJp4+zaeqyBET9Ziq7wl+qRgNeohAZAA5agMzUbupRook L2LBk+pgtkgmCspn+inFyNVPzLjllZ4TWQFXUaT+X9yZCotl21aAzJAsV9AS88FhoZiF salF6dW0yB+8QnH2bY2rd42zAYNlJ0LAaRXdE9qmZwTOohuWdgYMR8eLZz3UIKuO9v+Z rYjvS0nmxhy1gOjhmuZ86R3vXHxdroN9SeRutT4hRwrvwk7ehp13iUtnH032pRpkrtrJ bHECenzpRbD0Q4bOlp7J51i5VujZ6AY/EYni02Imdko4Ok2MB0KE5SZxOWkO0UQdYVUB 9HIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VJGIfDwELhjyInFIYDJOppfXMvaVEsGyj8OfDKeoTCg=; b=LzTcSrOdwhKyTHDkXPPUrWQ4pWwMWQRABLZNAi/rDErWz47FvWN/v2XwycdBAh34se H3uBI3WD/LWehJNwbwWGF/81CVFp0S7fzQYUJ4L7KLBksZJqwQmAfi3IIAgwq6FG99gM v6tPy5fK6RVRdUU5+zodzHqj5A18bWIVxBFASAmbDLapSfr4jh7wVyOlj1JyXsZF81Cq HrVinFixJyHiHpzNlerciKj0zP/6ghNoShFkyAUVCfrN2AH5Bc4u/XVbYNOj9ehpSjIH IbSZaYkZTkSgtCiyXbeRL973oWzXmmvteLMU2Vg3PLmhYVE/aPEkZxXUKSKGm5+lrv0n 6klg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="loSakum/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a187si10815458pge.296.2022.01.24.15.58.08; Mon, 24 Jan 2022 15:58:20 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="loSakum/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2366426AbiAXXwr (ORCPT + 99 others); Mon, 24 Jan 2022 18:52:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1845918AbiAXXNz (ORCPT ); Mon, 24 Jan 2022 18:13:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28614C067A73; Mon, 24 Jan 2022 13:20:02 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D9E18B80FA1; Mon, 24 Jan 2022 21:20:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E196C340E4; Mon, 24 Jan 2022 21:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059199; bh=2Q3z21wUM/yblriBfeXIPQJaC4MoMvTMrfXYkzT5yWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=loSakum/78fAD6gV6a5u74cKJ8hUtYHrgh84o5agO2Dl+0Y1KIKboRvO2kkQPE57r NBHeQWNvyxpT+ZfTaSplE3T6LQNu1P4waeW8Y5mDHjShY9bYeJrOXz8NL8IBkG7S2o TnzfaSWESRDK2Cvc+ZvLi0q6yJjCMc0GUtwlbGFs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Justin He , Sudeep Holla , Jassi Brar , Sasha Levin Subject: [PATCH 5.16 0536/1039] mailbox: pcc: Handle all PCC subtypes correctly in pcc_mbox_irq Date: Mon, 24 Jan 2022 19:38:45 +0100 Message-Id: <20220124184143.297944034@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sudeep Holla [ Upstream commit 7215a7857e796c655ae1184b313556102fa8bc40 ] Commit c45ded7e1135 ("mailbox: pcc: Add support for PCCT extended PCC subspaces(type 3/4)") enabled the type3/4 of PCCT, but the change in pcc_mbox_irq breaks the other PCC subtypes. The kernel reports a warning on an Ampere eMag server -->8 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.16.0-rc4 #127 Hardware name: MiTAC RAPTOR EV-883832-X3-0001/RAPTOR, BIOS 0.14 02/22/2019 Call trace: dump_backtrace+0x0/0x200 show_stack+0x20/0x30 dump_stack_lvl+0x68/0x84 dump_stack+0x18/0x34 __report_bad_irq+0x54/0x17c note_interrupt+0x330/0x428 handle_irq_event_percpu+0x90/0x98 handle_irq_event+0x4c/0x148 handle_fasteoi_irq+0xc4/0x188 generic_handle_domain_irq+0x44/0x68 gic_handle_irq+0x84/0x2ec call_on_irq_stack+0x28/0x34 do_interrupt_handler+0x88/0x90 el1_interrupt+0x48/0xb0 el1h_64_irq_handler+0x18/0x28 el1h_64_irq+0x7c/0x80 Fixes: c45ded7e1135 ("mailbox: pcc: Add support for PCCT extended PCC subspaces(type 3/4)") Reported-by: Justin He Tested-by: Justin He Signed-off-by: Sudeep Holla Signed-off-by: Jassi Brar Signed-off-by: Sasha Levin --- drivers/mailbox/pcc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index e0a1ab3861f0d..ed18936b8ce68 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -241,9 +241,11 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) if (ret) return IRQ_NONE; - val &= pchan->cmd_complete.status_mask; - if (!val) - return IRQ_NONE; + if (val) { /* Ensure GAS exists and value is non-zero */ + val &= pchan->cmd_complete.status_mask; + if (!val) + return IRQ_NONE; + } ret = pcc_chan_reg_read(&pchan->error, &val); if (ret) -- 2.34.1