Received: from linuxtv.org (140-211-166-241-openstack.osuosl.org [140.211.166.241]) (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 C666615B541 for ; Thu, 5 Sep 2024 08:21:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.211.166.241 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725524518; cv=none; b=W6d9vcVbjf1ij7wFdhpbzDhTOZsY5EROBGZdEA2wwbbFxNqKsQ9UWt4W89B6eNHdKPyrOCIslMBYXxRoCVZW44CzZzBSXnFeUv/5/oUEXBSW1NIXS1jNf8HHnsO6TPba8ER9Yk/bpL0eHQq0QIIgIWg/1NAPGoQlEpHC8OOT7GA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725524518; c=relaxed/simple; bh=zCMzth6Sa7g7pRT3hgV+qq9be4LXkCkRh07T0W47094=; h=From:Date:Subject:To:Cc:Message-Id; b=c1vqKjeWtfPOz76RZ53d1DmBKy3AkmmtHiYZxm53kCUXzjyZhrVwDuXDxmny2K6Ra+I9q1UrYleCpU8V+HYsYLkbvifnI5pWMKwTGX1KcPvsKxbkP9pIi5BtuO+ajXiSypW3yke7aQgniDyq4tZeu5+lBjoo9mOS3u9Zy9B9oE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=xs4all.nl; spf=pass smtp.mailfrom=linuxtv.org; arc=none smtp.client-ip=140.211.166.241 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=xs4all.nl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxtv.org Received: from mchehab by linuxtv.org with local (Exim 4.96) (envelope-from ) id 1sm7ka-0006yT-06; Thu, 05 Sep 2024 08:21:56 +0000 From: Hans Verkuil Date: Fri, 09 Aug 2024 05:56:38 +0000 Subject: [git:media_tree/master] media: qcom: camss: Fix ordering of pm_runtime_enable To: linuxtv-commits@linuxtv.org Cc: Bryan O'Donoghue , Konrad Dybcio , stable@vger.kernel.org, Johan Hovold Mail-followup-to: linux-media@vger.kernel.org Forward-to: linux-media@vger.kernel.org Reply-to: linux-media@vger.kernel.org Message-Id: Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: This is an automatic generated email to let you know that the following patch were queued: Subject: media: qcom: camss: Fix ordering of pm_runtime_enable Author: Bryan O'Donoghue Date: Mon Jul 29 13:42:03 2024 +0100 pm_runtime_enable() should happen prior to vfe_get() since vfe_get() calls pm_runtime_resume_and_get(). This is a basic race condition that doesn't show up for most users so is not widely reported. If you blacklist qcom-camss in modules.d and then subsequently modprobe the module post-boot it is possible to reliably show this error up. The kernel log for this error looks like this: qcom-camss ac5a000.camss: Failed to power up pipeline: -13 Fixes: 02afa816dbbf ("media: camss: Add basic runtime PM support") Reported-by: Johan Hovold Closes: https://lore.kernel.org/lkml/ZoVNHOTI0PKMNt4_@hovoldconsulting.com/ Tested-by: Johan Hovold Cc: Signed-off-by: Bryan O'Donoghue Reviewed-by: Konrad Dybcio Signed-off-by: Hans Verkuil drivers/media/platform/qcom/camss/camss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 51b1d3550421..d64985ca6e88 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -2283,6 +2283,8 @@ static int camss_probe(struct platform_device *pdev) v4l2_async_nf_init(&camss->notifier, &camss->v4l2_dev); + pm_runtime_enable(dev); + num_subdevs = camss_of_parse_ports(camss); if (num_subdevs < 0) { ret = num_subdevs; @@ -2323,8 +2325,6 @@ static int camss_probe(struct platform_device *pdev) } } - pm_runtime_enable(dev); - return 0; err_register_subdevs: @@ -2332,6 +2332,7 @@ err_register_subdevs: err_v4l2_device_unregister: v4l2_device_unregister(&camss->v4l2_dev); v4l2_async_nf_cleanup(&camss->notifier); + pm_runtime_disable(dev); err_genpd_cleanup: camss_genpd_cleanup(camss);