From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E54D191F95 for ; Wed, 29 Jan 2025 08:18:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738138739; cv=none; b=YUzBvEEvfDbz0a+Vou0tEocEQqrBzMvdNKyfTa/tpak9X7BXr/vrcQmMuE/VM1/LiZtVyhHwyyj8Gdx12y3EHRHoZxcA7FoHiJeN72wI8Z4R4rWBwptCJq3k1JTBhpmditabLez3JG2fJkPK62s+AnwXbmiXLzx7GV7ofUVpnCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738138739; c=relaxed/simple; bh=q9PcrzMuPfzgLcPzUpwqZmNu5XymU513cnx6sVwWVFo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hhtESkwsqhTUcqQbJPjoXTyCqx+juFqPZfgzflP0fdwWxWkwai4qt0djeC8DMiMi8z58RWP+MWaFkfPcOMo/0D8J3ikTeWDFo+rl9YYwk6rh1F3J360YKZMqJQTjN6d85wuOaS3VJPSHk0jVhqx2OiGyEGazv5bFxLlE/4QOqD8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=LVQPQi6s; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LVQPQi6s" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3863703258fso233447f8f.1 for ; Wed, 29 Jan 2025 00:18:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738138736; x=1738743536; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=sBd/IvDhQt1+2TptVTpiJN0NIdUgTEfHIRo89ZFgCVk=; b=LVQPQi6sNCb7mX5kgBxlrNFrqxlYx7PpCL/oZyUHeB0wjRtCv9znVMIJfwREwKQVeL DVBPF6Dogv3MexTgLpO1lP0awAjim5pThUbSWLmp6d5FO/z4zFTOEYIjfbINyuWN9c0G 46gvuDSP9vmyOeA0kNvKqltYjkRj+93wKtYX+gs8ebGIYn/q7mbaDtWXSLlySpevrkGC OhMYdfNssrzmuNc1nqIkfzTbYO7f3qB65fZYVctET0phQ8iaLyBA9SgB3ePvXrqzJc6B NbBRX5AIU/UCrHXDBHM2Qrcg5vk1OpaXJ38bASdxtKZGOdnwFcTYjbU1YcLoi92kA7Cd P/yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738138736; x=1738743536; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sBd/IvDhQt1+2TptVTpiJN0NIdUgTEfHIRo89ZFgCVk=; b=jyjSEIqCFHuVK3s3T9T4kmPbgEmm4WLiqvDx0QhsdxFRhQ+3UeZQKZzG6WPFPmHz7U UIPjOqWXAfWI9tWdB++s6mPVkL9PKLpYM/ghknFgnpz6/y90grsD470v+R4u4RWKRaXN 4XGOFgwARHDObsnpxZBfHoCKXGj4l6Ev1wsf6I8AMSqjhUDphZhJUWBBtrccvAzN8864 qksSa/qaPuM7IimklchKY5KLEfU3pbr6BBlV3Cald/I+TXDEHEQ77UGyJ2vhy074qVcm VskEpR2N/uRB8+mu7oq1QVT0VztMhrWBiffcHxtmW9tJxE/i6VPw/v5nz4cKSUz1ROq5 HKGw== X-Forwarded-Encrypted: i=1; AJvYcCWqrrHeA8mg17e5RlMFaNtfRfZASeMEmhPs6sj63KiYUe10PEhd3aVM56LsKO9IOA+pUjPAnSCl1yTjJ0w=@vger.kernel.org X-Gm-Message-State: AOJu0YxH40L8ND/6uVQx11B2HwtVdpLi/og0Pdc8zswoW1CriVgOr/RF D/DuV2B2MhMlMdOgQcDtjZfanqGbEoAsBeShLfgQ522/m83OB5z/zjlMzi2E8nQ= X-Gm-Gg: ASbGncs1wNglcwnHoS0vTKRc3XpzkeAP3w9rOj4ie36D75gjZwT9cBPnNVMatQX1uDH ZtzpXUo4XSeT0ef3z1WsYiMsQTFvmLx+IFecukra4GLLiRpsOQbtzdDcujqjDScySMDxZ/9r66m 4tlYAFGc8Mfnvo0VWrp2J3Z/amiM1IBXr2nyIpeSNLES/dBIpxXhVeaBHB+wAi0I+2imFaPVGtE egeMyiSp8OCzstQggKARP1LzLxYikijA8yGm/ne8oBl3t9f16P5ubL2EEpXl/lM0jUoQueUo8Jj Nhld7qNn6GMAyXzYjuwSgA== X-Google-Smtp-Source: AGHT+IGmg5YJ8EYXcU1LFQKEauB6McbRp8WqEK3RkkgOQScrIqPuhUbg3IfCBmWCpqf/pdOzRDnMyA== X-Received: by 2002:a05:6000:156d:b0:38c:24c6:5bdc with SMTP id ffacd0b85a97d-38c50fdff42mr1517193f8f.4.1738138735865; Wed, 29 Jan 2025 00:18:55 -0800 (PST) Received: from linaro.org ([77.64.147.194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a189283sm16542483f8f.59.2025.01.29.00.18.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jan 2025 00:18:55 -0800 (PST) Date: Wed, 29 Jan 2025 09:18:51 +0100 From: Stephan Gerhold To: Luca Weiss Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Bjorn Andersson , Mathieu Poirier , Sibi Sankar , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] remoteproc: qcom_q6v5_pas: Make single-PD handling more robust Message-ID: References: <20250128-pas-singlepd-v1-0-85d9ae4b0093@lucaweiss.eu> <20250128-pas-singlepd-v1-2-85d9ae4b0093@lucaweiss.eu> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250128-pas-singlepd-v1-2-85d9ae4b0093@lucaweiss.eu> On Tue, Jan 28, 2025 at 10:54:00PM +0100, Luca Weiss wrote: > 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 Not sure if Reviewed-by makes sense if I already did Suggested-by, but anyway: Reviewed-by: Stephan Gerhold Thanks for making these fixes! > --- > 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 aca44bb6522f00cb525c4b816040445287444434..c1e9bbae61770ccad3e22d132a411bc6ced7180f 100644 > --- a/drivers/remoteproc/qcom_q6v5_pas.c > +++ b/drivers/remoteproc/qcom_q6v5_pas.c > @@ -509,16 +509,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])) { > @@ -543,7 +543,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.48.1 >