[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250313-pcc_fixes_updates-v3-4-019a4aa74d0f@arm.com>
Date: Thu, 13 Mar 2025 15:28:50 +0000
From: Sudeep Holla <sudeep.holla@....com>
To: linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Sudeep Holla <sudeep.holla@....com>,
Jassi Brar <jassisinghbrar@...il.com>, Huisong Li <lihuisong@...wei.com>,
Adam Young <admiyo@...amperecomputing.com>,
Robbie King <robbiek@...ghtlabs.com>
Subject: [PATCH v3 04/13] mailbox: pcc: Return early if no GAS register
from pcc_mbox_cmd_complete_check
pcc_mbox_cmd_complete_check() accesses pchan->cmd_complete.gas to check
command completion status. Even if GAS is NULL, pcc_chan_reg_read() gets
called which returns success doing nothing and then we return.
Add an early return if pchan->cmd_complete.gas == NULL before performing
any operations.
Acked-by: Huisong Li <lihuisong@...wei.com>
Tested-by: Huisong Li <lihuisong@...wei.com>
Tested-by: Adam Young <admiyo@...amperecomputing.com>
Signed-off-by: Sudeep Holla <sudeep.holla@....com>
---
drivers/mailbox/pcc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index 9cf0ca772c1adb73ceb91d25a2abd1d12c678d90..7105dd6bc2fc6b8d36cb62f7ecd1b578361f89b6 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -245,13 +245,13 @@ static bool pcc_mbox_cmd_complete_check(struct pcc_chan_info *pchan)
u64 val;
int ret;
+ if (!pchan->cmd_complete.gas)
+ return true;
+
ret = pcc_chan_reg_read(&pchan->cmd_complete, &val);
if (ret)
return false;
- if (!pchan->cmd_complete.gas)
- return true;
-
/*
* Judge if the channel respond the interrupt based on the value of
* command complete.
--
2.34.1
Powered by blists - more mailing lists