From nobody Thu Nov 28 15:49:04 2024 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (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 66A8F15F3F9 for ; Mon, 30 Sep 2024 09:08:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727687330; cv=none; b=mo/3w6hQcu4qPFhDdkw0F0bGHAKsaNIhtlc3eSDFH7/ENL3+xVRQ5cZ4NTznhtbX8NZZ5bdUUTSHnCj1mtzTZQv1t2YOrTnDh2RFw1QK5DN5ykU3iHlc6G9SfiB3ptYyBWJKH8aDbbGMX0JgnK9hsSlYlddM+A6oDm7na6yX4UE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727687330; c=relaxed/simple; bh=mFhltLjTu0quhT0VytR9MAdThF9MxuuKIYnoCXOSP38=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=vARJ8LG5CqPEwLIzuqt33Drps3jUE5khUamWw26wuD0F0ltuvWkOq8hA7C7muAG9ljC8Q2ACEq/ocUn8IBAATpspJy43A79KFJD1W76PH7sVX6Iwe+GJ6zhC2LVXrPh32s54/GZNs6t8aHYfrhJTpar1mdzj3KBd9KVcmWQF3vk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4XHFbB6Xwvz2Dd13; Mon, 30 Sep 2024 17:07:50 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id 9581D1401E9; Mon, 30 Sep 2024 17:08:44 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 30 Sep 2024 17:08:44 +0800 From: Jinjie Ruan To: , , , , , , CC: Subject: [PATCH v2] i3c: master: svc: Fix pm_runtime_set_suspended() with runtime pm enabled Date: Mon, 30 Sep 2024 17:19:13 +0800 Message-ID: <20240930091913.2545510-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemh500013.china.huawei.com (7.202.181.146) Content-Type: text/plain; charset="utf-8" It is not valid to call pm_runtime_set_suspended() for devices with runtime PM enabled because it returns -EAGAIN if it is enabled already and working. So, call pm_runtime_disable() before to fix it. Cc: stable@vger.kernel.org # v5.17 Fixes: 05be23ef78f7 ("i3c: master: svc: add runtime pm support") Reviewed-by: Frank Li Reviewed-by: Miquel Raynal Signed-off-by: Jinjie Ruan --- v2: - Add Reviewed-by. - Add stable tag as Miquel suggested. --- drivers/i3c/master/svc-i3c-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i= 3c-master.c index a7bfc678153e..130cec4ee307 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -1827,8 +1827,8 @@ static int svc_i3c_master_probe(struct platform_devic= e *pdev) rpm_disable: pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_put_noidle(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); pm_runtime_disable(&pdev->dev); + pm_runtime_set_suspended(&pdev->dev); =20 err_disable_clks: svc_i3c_master_unprepare_clks(master); --=20 2.34.1