From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 0793146EF7E for ; Wed, 22 Jul 2026 11:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784721189; cv=none; b=d7bM7L45RHcGbrFWwhYmK2bi5k7Blmqtfgvq1las/jBo8Ez+7JPHu/SGfTqb27raG4WsZNFEN1E0WvswUQuSO6fPrhrWV5Aq2bCaq37PMwwAyx3u9GP/5P+8I1oKbmwPZ8WodTg1X9bb7U11thpC8ns4FPGo9dxlsK2Sq1Hm76s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784721189; c=relaxed/simple; bh=ZQAVPwSpl3VDjI66z0UBts+n05kZOufYw2+A2L7AmPI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZezKFLR7fzkefmviQFcVk6RvVYaK98UK+r6gCijEf4MuUxiFOLycwZMuAW/U2tlPf7CWurLkMJllgXDCUYq92X1ew1iXmbefoHUSvu/NRRTzghImaQqybJy5mLWtYKeMrI4T+YvjtV+AeG0dSDILUME9G6Jno3rbzLpxEzGX8I8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WgDrVyJz; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WgDrVyJz" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2cf27856f9cso72097305ad.2 for ; Wed, 22 Jul 2026 04:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784721187; x=1785325987; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Torbo9QkuXmjC9uhqrdt2cyIRnXWvhPFN491HA78teQ=; b=WgDrVyJzEJc6z/oyJ2/YhJIMeFgh63KzD5dcZljqJciZX24YEYotFWCYD8cYYyFINR DBWDyqbNv4dvlcZKdHzFRbKclGszGpVq08npKjtOGW1DwWfp2iTlD1CTZUT8z4cQpxI/ RU1Hc89u2EYHWpns8kpWwjyI8z5zW/qU7lfC+9kN7Q1vqsGSgYNFjcpPzmchhLrZwzIY 7BGFf1XIpHxKwq7+XG4qC9HfUv3HF9MJolnnWTp3All5gd7ogXB7XXt/p21agq4f6q0F QwDbdICoU4rBhWJ8/iATMnl4ewCTOPEBk9ysOmqm0DGkYLCB2l0j/6Jka8WtNRzCJlxR CsuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784721187; x=1785325987; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Torbo9QkuXmjC9uhqrdt2cyIRnXWvhPFN491HA78teQ=; b=I9TGXfcDjja6x7VRKLE6Oqd62Hs3QMVf/5Y7JC457f/5i74JscL8Ht8On6Akb1L4ux 6Yw9Bg63Q+pfBvdAgfaAZm0cj7P5H96Hwo0wdokJ3tw5wkv8f7CBVBvm8Ktwcvvnt+xg 1oUJQH2SUfWDjPdaLSf6Wd9GIswT3YBwn8eJnGE+2M/1Ga5vREcgMzUbydt/wPb+7hi3 7FOAtpB+pDH0Vg8Sc+1eAbZ5ALjOuWk+iXQpL2FNyzeL8vNFOKsya7X3w50Z9w9pMWWI NbHM35xCJETa+cEBViQ3uJ6+8EmsTZtZ3KFTEE2N3JqwDk+iv18RtY7ZvnmKJbS9CwS4 2kGA== X-Forwarded-Encrypted: i=1; AHgh+RouV9zBi75VhxtFySUUjJmenhlqp/Ezwa2RfXR71XgZOtyCTesAWbYKWfeyT0DqcagysDUFRWd9/rgZwTw=@vger.kernel.org X-Gm-Message-State: AOJu0YwRh++R81wHjMlr323qyzGQ8u5PxYB32S0YJZP0BEKYnM4zwiga wQbyD6flIMQ/o9cpxN95UNs81/G+AWCU8de+VBLJ6EQiaSfVq1aT6Ghe X-Gm-Gg: AR+sD12FN7ITbmPoyw2vUZk2OL88vUp6oUHFUDp/vxMg0iWB8IMsn2rMY/BR44Atijw U5SbkgR/uAGiD1HUR2h4DmE88jO00Qq7pzln1WGY+Kx/QauHfUX8XJtDvT38Jjd5aAtvF81mWKO G7JTSAHA5Gi+vjYAoc+dVLa2kkNbieF/JEVNWw/ZuNx9knSZsX4A0tGcbL0EO4vJZiuzcRciL0x AKfVPnBOSEY/4hTWjILjyDzQjsvpcD+9sEu3KoxrBoah2DOuwwzV/xfCy3/NqPWnU/74E7gagWV qbbk+N88jUfKJFtm9IytHSVXn2PoXSnonVnQwgBBovgvQp4IPhxoPF5yg6zNFyUTyVVBOrRK1ot n1bjkHcGceolD6e7j1zjQOXNJP85T/lx5I/wCq/XG4wDdK55XyNZY4ULmTPUA0B3+sRlG6/oPFw n7BdlMdv9OQWpuJMJ7EAaH7aJupLSUeIkYbe+R X-Received: by 2002:a17:902:ce83:b0:2ce:ceef:6632 with SMTP id d9443c01a7336-2cf34948972mr262802425ad.26.1784721187139; Wed, 22 Jul 2026 04:53:07 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf8f2e6247sm13376205ad.54.2026.07.22.04.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 04:53:06 -0700 (PDT) From: phucduc.bui@gmail.com To: Nicolas Frattaroli , Liam Girdwood , Mark Brown , Jaroslav Kysela , Heiko Stuebner Cc: linux-rockchip@lists.infradead.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bui duc phuc Subject: [PATCH v2 2/2] ASoC: rockchip: rockchip_sai: Fix runtime PM state after manual resume Date: Wed, 22 Jul 2026 18:52:50 +0700 Message-ID: <20260722115250.62588-2-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260722115250.62588-1-phucduc.bui@gmail.com> References: <20260722115250.62588-1-phucduc.bui@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bui duc phuc Probe manually resumes the device after pm_runtime_get_noresume(). Since the PM core is bypassed, runtime_status remains RPM_SUSPENDED even though the hardware is active. A subsequent pm_runtime_put() therefore skips runtime_suspend(), leaving the device permanently powered and preventing autosuspend. Fix this by calling pm_runtime_set_active() after the manual resume succeeds, and defer pm_runtime_enable() until after the device has been manually resumed and marked active. Also call pm_runtime_put_noidle() on error to drop the usage count acquired by pm_runtime_get_noresume(). Signed-off-by: bui duc phuc --- sound/soc/rockchip/rockchip_sai.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/rockchip/rockchip_sai.c b/sound/soc/rockchip/rockchip_sai.c index 9a80e120dbda..55d17536c3b5 100644 --- a/sound/soc/rockchip/rockchip_sai.c +++ b/sound/soc/rockchip/rockchip_sai.c @@ -1474,11 +1474,14 @@ static int rockchip_sai_probe(struct platform_device *pdev) * * NB: we don't rely on _resume_and_get in case of !CONFIG_PM */ - devm_pm_runtime_enable(&pdev->dev); pm_runtime_get_noresume(&pdev->dev); ret = rockchip_sai_runtime_resume(&pdev->dev); - if (ret) + if (ret) { + pm_runtime_put_noidle(&pdev->dev); return dev_err_probe(&pdev->dev, ret, "Failed to resume device\n"); + } + pm_runtime_set_active(&pdev->dev); + devm_pm_runtime_enable(&pdev->dev); ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); if (ret) { -- 2.43.0