From patchwork Fri Nov 1 09:40:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 840487 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 3C62715667B; Fri, 1 Nov 2024 09:41:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730454097; cv=none; b=L6jiEUiWfb8dFOaNUYqawuOLJuQRT/zT0715UWASs3X9U7JDBaqB5A224v03gXTipCsBBWYMQmESs3ze5hga88SRKHECyfpci/qG+H22TpU5stzToHG4Jvvx2akWQHvnCFIKnlrSOHsF3xiTaZOUqgO9EdmaKYCARuAYjgH6d0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730454097; c=relaxed/simple; bh=EDUkQtfNBeqggKtTDqGaUGqzrG/JbmviQpQegALOkIQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lpJjQCo7EqyIjbSmP5i6mWEY0TP9FYXVN0bpKOyhCNHS1KGgwYtky4rRjbaSv8fc8hIFd4pcT8FMZxtMQWrSK+LwkMaWO9hdkbtcXabeBF1SAq+0xBAX4bGB7pJrkbEbfru7roHca2Hcw34a+UInhSnFLYSCt5UnJI1cZgorENE= 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.188 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.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4XfwmK6bqGzdkXj; Fri, 1 Nov 2024 17:38:57 +0800 (CST) Received: from kwepemg200008.china.huawei.com (unknown [7.202.181.35]) by mail.maildlp.com (Postfix) with ESMTPS id 6E1A2180115; 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:31 +0800 From: Jinjie Ruan To: , , , , , , , , , , , CC: , Subject: [PATCH v2 2/3] media: amphion: Fix pm_runtime_set_suspended() with runtime pm enabled Date: Fri, 1 Nov 2024 17:40:49 +0800 Message-ID: <20241101094050.2421038-3-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: b50a64fc54af ("media: amphion: add amphion vpu device driver") Signed-off-by: Jinjie Ruan --- v2: - Add fix tag. - Add Cc stable. --- drivers/media/platform/amphion/vpu_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/amphion/vpu_drv.c b/drivers/media/platform/amphion/vpu_drv.c index 2bf70aafd2ba..51d5234869f5 100644 --- a/drivers/media/platform/amphion/vpu_drv.c +++ b/drivers/media/platform/amphion/vpu_drv.c @@ -151,8 +151,8 @@ static int vpu_probe(struct platform_device *pdev) media_device_cleanup(&vpu->mdev); v4l2_device_unregister(&vpu->v4l2_dev); err_vpu_deinit: - pm_runtime_set_suspended(dev); pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); return ret; } 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: 840486 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 --- 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);