From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7131F267B7F; Tue, 8 Apr 2025 11:00:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744110038; cv=none; b=rP36ZGuyjzxidmUcOhIj0HCxyird+7F8wnS6HjY1GJoTaQoKIs84tjzLlKYn4z3XzauXtrtifQ3wWVK7U1uinaUaRrq11qif6K6r1EHCBoVuN2T4OTLxWbTSh8u0N9wV6OjCnpqDPhzIFjuNbHzu14wOQ4O4Zo9z6fKjNDGxn1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744110038; c=relaxed/simple; bh=s8xQjAVEkYi7yUAlGhjkshFVARkDFS36Lt9JrO1/ees=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mWuAfOxs3wQnO5NPxikCDzAI2DHWqX0Z4tx/GrhqihzAdKRkbYxMggZhAN7S2adKFWv+59Wlk1rlrtYv5Vb3puUq8uuvhq9h7O0/9KKY+VWnODAMzWlShqv1gUT5qKraTzbtvhi/mjBz02J4Gp4FZ3Y5MHuCtfeAxKLxdTSmeX8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gkx8cxYR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="gkx8cxYR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 038A3C4CEE7; Tue, 8 Apr 2025 11:00:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744110038; bh=s8xQjAVEkYi7yUAlGhjkshFVARkDFS36Lt9JrO1/ees=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gkx8cxYR8G+BJodJsX/Fc0km4qfM77yTh3/mPXDh/1c8lTTvG7nR+96m2H++0/oAy QxGn22GvY/GY2A4tRhfODVVbFaGKuk/U5wJlcnYLyENgZa47U2+Cq/Nkex/SsooN/Q LCyQiCLdxG1sBfvSoifXrjz4nL77AUpgpVObOU8M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Stephan Gerhold , Luca Weiss , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.10 145/227] remoteproc: qcom_q6v5_pas: Make single-PD handling more robust Date: Tue, 8 Apr 2025 12:48:43 +0200 Message-ID: <20250408104824.658128796@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250408104820.353768086@linuxfoundation.org> References: <20250408104820.353768086@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luca Weiss [ Upstream commit e917b73234b02aa4966325e7380d2559bf127ba9 ] Only go into the if condition for single-PD handling when there's actually just one power domain specified there. Otherwise it'll be an issue in the dts and we should fail in the regular code path. This also mirrors the latest changes in the qcom_q6v5_mss driver. Suggested-by: Stephan Gerhold Fixes: 17ee2fb4e856 ("remoteproc: qcom: pas: Vote for active/proxy power domains") Signed-off-by: Luca Weiss Reviewed-by: Stephan Gerhold Link: https://lore.kernel.org/r/20250128-pas-singlepd-v1-2-85d9ae4b0093@lucaweiss.eu Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/remoteproc/qcom_q6v5_pas.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 1a0d6eb9425bb..653d204338285 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -309,16 +309,16 @@ static int adsp_pds_attach(struct device *dev, struct device **devs, if (!pd_names) return 0; + while (pd_names[num_pds]) + num_pds++; + /* Handle single power domain */ - if (dev->pm_domain) { + if (num_pds == 1 && dev->pm_domain) { devs[0] = dev; pm_runtime_enable(dev); return 1; } - while (pd_names[num_pds]) - num_pds++; - for (i = 0; i < num_pds; i++) { devs[i] = dev_pm_domain_attach_by_name(dev, pd_names[i]); if (IS_ERR_OR_NULL(devs[i])) { @@ -343,7 +343,7 @@ static void adsp_pds_detach(struct qcom_adsp *adsp, struct device **pds, int i; /* Handle single power domain */ - if (dev->pm_domain && pd_count) { + if (pd_count == 1 && dev->pm_domain) { pm_runtime_disable(dev); return; } -- 2.39.5