From patchwork Fri Nov 1 09:40:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13859035 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (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 A37AC156C71; Fri, 1 Nov 2024 09:41:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730454098; cv=none; b=TJZq8oCoykug/JTpKQ/dzBGcMPiZuS5cBpeOk6vmy5PN/JOEGnnbP/Opzam/XY8niGJ1Kb5GHl1R4SP0blalXzK01ZmtUNyAkKX/mQPbMtEKQfZRw93dmUMr0rioJIo37C3w82xJYRaCORNK3bw6yk1qfcSGuKJnlOsZqIl1vLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730454098; c=relaxed/simple; bh=WgGBNRaDj18Fmg/UzNoNhKY/fpm/63w6fDav6PV+78s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=No9VWnBazraxh3sUUrmlUKuzcxFvXA0b4XcfwG6yIt6wAUQMbEzGJBMjwjQpwVNyrL1s/wGrSK8l7NWfdmExs1DW4mcj5hC834GZYIgcDnt+5sJBmBlnmhBIEdoUqkRqE5fnQ3AFgzxPof/fi9lNZvBE3oV6nFPozXu/5ifK0qk= 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.255 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.163.48]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Xfwml4HXNz1T9Tg; Fri, 1 Nov 2024 17:39:19 +0800 (CST) Received: from kwepemg200008.china.huawei.com (unknown [7.202.181.35]) by mail.maildlp.com (Postfix) with ESMTPS id F140218005F; Fri, 1 Nov 2024 17:41:32 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemg200008.china.huawei.com (7.202.181.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 1 Nov 2024 17:41:32 +0800 From: Jinjie Ruan To: , , , , , , , , , , , CC: , Subject: [PATCH v2 3/3] media: venus: Fix pm_runtime_set_suspended() with runtime pm enabled Date: Fri, 1 Nov 2024 17:40:50 +0800 Message-ID: <20241101094050.2421038-4-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241101094050.2421038-1-ruanjinjie@huawei.com> References: <20241101094050.2421038-1-ruanjinjie@huawei.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemg200008.china.huawei.com (7.202.181.35) 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 Fixes: af2c3834c8ca ("[media] media: venus: adding core part and helper functions") Signed-off-by: Jinjie Ruan Reviewed-by: Bryan O'Donoghue Acked-by: Stanimir Varbanov --- v2: - Add Cc stable. --- drivers/media/platform/qcom/venus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 84e95a46dfc9..cabcf710c046 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -412,8 +412,8 @@ static int venus_probe(struct platform_device *pdev) of_platform_depopulate(dev); err_runtime_disable: pm_runtime_put_noidle(dev); - pm_runtime_set_suspended(dev); pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); hfi_destroy(core); err_core_deinit: hfi_core_deinit(core, false);