From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 EA8053E0C68 for ; Fri, 8 May 2026 13:41:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247663; cv=none; b=ljyjxKSzBUlw45PxphZDe9Idj22JmGirC8YTRUssD3z8Zgou7yvJoFj8dEVoyTyjxhAiURiwzJ+ar+RuiFibyEmy9cNoY5hwmTrlf2ri2/aQBGOtNmUviqhBDsqaRV1aChZRoYdvagZjxcdRqTdN0U+t/OPIHxdwg64RSdwi/10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247663; c=relaxed/simple; bh=GsrsjJfrmd1hi8mZlxFpPo0t8Qi+/KDd3IEbRtHDkF8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rtIW7FVKwhPCA8bJ5Ob1eMBgNlh4bIv+6JsMcBmuvz7qtli5q9OpelyNRZrNavQh+gDXTzLzx4aexQDdInktdEWDGll1EB7CVmB8FSc6Nh9cXNbOs7QtEO6NGr2pi+yQc0dMxLBN9y4a5UTAYk9osjcszxM1wqq/MgycNVG4j/M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=op5jTyhE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=amnqz/6D; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="op5jTyhE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="amnqz/6D" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 648Ba6ES2778221 for ; Fri, 8 May 2026 13:41:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Ew1QykUYMfqGkPhQAGD7yJTCSOwC3LlUxyKWVUGR5Q4=; b=op5jTyhE13GTQYNh 1MOtVe3Un2yeycXmJ/2DQEIdlc/8mC4UYJ2cBDPBuwpfZ8lHTqLkIIQB66p/qzBA sFTfKqkRXDec8uOTdilorJMQXQcyuHTHWae14oC1I5vnqjcuGAzeq3xOpmO+OduX GNcIdBeuauOve18aaCjSJ9wiOsOWDRqWjg14VuRmYMxgiCBAjb+A5/TAx3DGRnsY 0d0+02oy+cvZudRYRtq1Pe2zuSwAxAHZrNj/wrI/PSQA3oUdb72x9rdnlKWkcY31 qFC+w7N0YJ6KXXm0zFe87AgOuHihon0JuOu0SG8EBQjGbAQ5PCDUTiLdQrtBuBNM h2WIXw== Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e1285kd1j-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 08 May 2026 13:41:01 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-95cd22ec862so149825241.3 for ; Fri, 08 May 2026 06:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778247660; x=1778852460; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Ew1QykUYMfqGkPhQAGD7yJTCSOwC3LlUxyKWVUGR5Q4=; b=amnqz/6DEKcw5uRNryOKIZWOUHMLsrIHky3/kxEnxjRV/sZ6JfwoRVNqPq/nmTV+hn k7dPXwSNmROHwmNMDWKX2iu3r3tPdiG6GnWlwSnXeaKMLiCBs1mxK2B4nIQQmDWHA9Yn /KtpQbeQ3o3x/DK7spDTJQFyTElzU0oc6imbRx3tFHZnCG/gdbwCF96faS+Pn9ZHjiDc Gx7dx9z6Db9pbQLKCN8ajg94IobK0u724DoZMljBlYI48s7NDCFJ7BInSyoETmifc3CC Y3kXJTPYLUo5gm4DKd9xEtFhntX5fgfHc2l9Glas4/JahsSuezjujLL5NC1ZZ+jYULPM n+DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778247660; x=1778852460; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ew1QykUYMfqGkPhQAGD7yJTCSOwC3LlUxyKWVUGR5Q4=; b=RITT8lU4xHlj4Ko0fIbmpGy7L8kJgeBSVOyzpo+LgABLG9OowOk0ugfw+ildzSh+op 2mi5V2iTofY0s6bIsY7MbrVBKv6mOJu88DwVFljn9BlgnKgU5Jraq6NIPkQHSVqJoOVP hySQYloWzUQCTQwHNKUyXdFJsOM2cTiCBDEMPiN7Dk84XT+Loq8Q4L2uOwHHtI+cb7aE mytsu/BFnSQx6x6iBKmDKDvxKZtM4NhJEbWBlLMaD8uHAkKhXVwxJmKLEVPaNuwaIP78 FTuWF2aGRHxa25TpGn5iUFekU52hfGybabMf0qbuc1ZrXSzVpU7/NXno59DsyM+hRbEU 8D0A== X-Forwarded-Encrypted: i=1; AFNElJ+fqTbkj+vCqwRIphDS+ydqRaoEB2inX9KW2yZhEvyULkB1g4KxibRaoz82If/egdAJwmM+WT4nXkf1ZeM=@vger.kernel.org X-Gm-Message-State: AOJu0YyEyuP3nPilVFUNoC3SbmI+inr8LNadk4WeGOgntiFt41eSNHfr A75qgp/TiirSwPtOIo0XeNncnxMKtCIYReHJfv5DyAl0FDurR/fsUcuGxDbuISQarVf9IAKj/im g7nhKl11RswFgqduUElYaW6/noDdTsHUtEJLWV813R9IY0O2L8v3+0TxEeuVZaH+KJxo= X-Gm-Gg: Acq92OEyQuuWC/8m51xnDPNFnigQ6w4RKptLvcJJNAu6DSfZ+rmHQhqpsKWfnLNkrrr 3d0ndBLCoNAbHG6j4KQUeaR926Lf4MA5+TzugoamjqJE6M7eTuHMrYanHxlJN4bjNQ8Y8XKt9gX 1BjjOBIf+rO2MsjjdzcHZNg/13wh7YtJGyfUTZ2BmniwSg25BRCLN4JQAgAOC9tKBumpBPzG8NJ 8efblSF7k1xgrPOE1vwVM6lU2hsiD6xsTDKOgC35khHlLcYMis0XUI0fyaZeHa8sC6qtqC47FqA WQSbbAIg+3oPZwsArhKzU0hwWDizxsXUSqAQdNdUhpEMCd1YmZKINWMzDsILpV/GY9zeG9vPzOC oC8u8ZfBOF30qjr0Q+Zz03Z/u1eWJPef35cT6dEkIEWVPPsfHEl715lr5h7SJTdIv+bGQ3u+HBT G1H9Y= X-Received: by 2002:a05:6102:4425:b0:62f:fed:d334 with SMTP id ada2fe7eead31-630f8fc748amr2947900137.4.1778247660070; Fri, 08 May 2026 06:41:00 -0700 (PDT) X-Received: by 2002:a05:6102:4425:b0:62f:fed:d334 with SMTP id ada2fe7eead31-630f8fc748amr2947891137.4.1778247659555; Fri, 08 May 2026 06:40:59 -0700 (PDT) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bcac3a7f89fsm80509266b.29.2026.05.08.06.40.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 May 2026 06:40:58 -0700 (PDT) Message-ID: Date: Fri, 8 May 2026 15:40:56 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PM To: Ajay Kumar Nandam , Bjorn Andersson , Linus Walleij Cc: linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260508113636.3561383-1-ajay.nandam@oss.qualcomm.com> <20260508113636.3561383-3-ajay.nandam@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20260508113636.3561383-3-ajay.nandam@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA4MDE0MSBTYWx0ZWRfX6aCInXKkpKcB lRi/e9VYEdJ98rQzW0M47FEK7ayWtFx6WLhe2eDSxgopUp7dnNGY067W+hT2sknTvThg7opVk+4 FGJNyMPoC0ahAXvipqQk5aZGkKeNC7oNb0m2kEQyf3RVH562y0awiOMKNG6mJlpJ5fwvpeG8zBg oQViBqCRCkfNldQpY4wXT21haAwPu0RbLtwpBIBBrc6SLQlvKg06SbwX1Sf1s5/qWTlY31nNEx3 Cw0HUDi2Sivc7TpVKk5x/6phhs4AxqpegQKpVv6gSffFxnbQiRtsBi+QpNvk4EnTo2SjQvRal3H UzwSkfuTWxnVN7H3ucM6RguBGl4g3cDtEZ0JgIntUetx+iMDVSQGmfMwD0mjO8+M137z2/Spzwm odIvsbc0STNuUOKY9fFdB5E64SAqJJynYZmIrHJWVmewxeQeOD14LbZo5MIWZeTQSCE3Q9kRkk9 aQvpUigj14sVmdOxrNw== X-Proofpoint-GUID: 9MTiB-pO3CyWYew2G8jynmFBI6VWhspc X-Proofpoint-ORIG-GUID: 9MTiB-pO3CyWYew2G8jynmFBI6VWhspc X-Authority-Analysis: v=2.4 cv=NKblPU6g c=1 sm=1 tr=0 ts=69fde7ed cx=c_pps a=KB4UBwrhAZV1kjiGHFQexw==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=taKbEZwsV8UQGDR8iwEA:9 a=QEXdDO2ut3YA:10 a=o1xkdb1NAhiiM49bd1HK:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-07_02,2026-05-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 spamscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 suspectscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605080141 On 5/8/26 1:36 PM, Ajay Kumar Nandam wrote: > Convert the LPASS LPI pinctrl driver to use the PM clock framework for > runtime power management. > > This allows the LPASS LPI pinctrl driver to drop clock votes when idle, > improves power efficiency on platforms using LPASS LPI island mode, and > aligns the driver with common runtime PM patterns used across Qualcomm > LPASS subsystems. > > Guard GPIO register read/write helpers and slew-rate register programming > with synchronous runtime PM calls so the device is active during MMIO > operations whenever autosuspend is enabled. > > Signed-off-by: Ajay Kumar Nandam > --- [...] > for (i = 0; i < g->nfuncs; i++) { > if (g->funcs[i] == function) > @@ -119,7 +133,9 @@ static int lpi_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned int function, > return -EINVAL; > > mutex_lock(&pctrl->lock); > - val = lpi_gpio_read(pctrl, pin, LPI_GPIO_CFG_REG); > + ret = lpi_gpio_read(pctrl, pin, LPI_GPIO_CFG_REG, &val); > + if (ret) > + goto unlock; Please remove the mutex_unlock/goto calls and replace the mutex_lock with guard(mutex)(&pctrl->lock) instead. This will use the scoped cleanup mechanism and let you simply return directly, shrinking the diff [...] > + pm_runtime_set_autosuspend_delay(dev, 100); > + pm_runtime_use_autosuspend(dev); > + devm_pm_runtime_enable(dev); devm_pm_runtime_enable() can fail, please check its return code nota bene pm_runtime_put_autosuspend() also can, but it's much less of a problem I gave this patchset a spin on 8280 CRD and seems to work fine, nice! Konrad