From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 919491DE2AE; Tue, 8 Oct 2024 13:03:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728392603; cv=none; b=JFGLmY8a3EF7vmUkqrzfBjrYgmEgfIVeddRWcCr2gzak8ET9d9UU/hLeflnDKLIW1KbEph6YMcRHRyprT6323ugic1xXjRMKXoVkgHPA2kRKSks5y1PT4IUgky78ROY5sziM/yi63RhMItPKLI/2v5xLHPAByIL+DLvkyps0lsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728392603; c=relaxed/simple; bh=TOSNvSB8T/CS3JNcBVvh9kx9xsxBTIiYkEkmUNQEBmA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kwxwZUhiMpmLlY0DA/Uing+0+oOXFHA5U5dl6JBCzOVEQ4MQ1v+COEYvnI1KzeR+DVMxS83v5pUDaf3DdtwTuWZTACNunFFQKm/eaeJgJhKQ5GYR7Aldt665oVIqKkgS21Y/h/1x5axe/xQJ0wSowT/rikFKzUpxOHQkFpiOOp0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nEJOnWBq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nEJOnWBq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED51BC4CEC7; Tue, 8 Oct 2024 13:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728392603; bh=TOSNvSB8T/CS3JNcBVvh9kx9xsxBTIiYkEkmUNQEBmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nEJOnWBqcUA7jp2pyiRiwN5jUXhxDf3u9qqTejX25dQOYTkogkPbWlxJasT9Q2HUg uHI/vqsW82u6Os4S2qEWe53hbl0KvB8Nb59TRRGGt56BFWrdUbi88AWnLY1kVdcv0S kmHYm9okhZR8uyZMtrzzvIb/nk9nZWeCEZsEgl4c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Johan Hovold , Bryan ODonoghue , Konrad Dybcio , Hans Verkuil Subject: [PATCH 6.11 464/558] media: qcom: camss: Fix ordering of pm_runtime_enable Date: Tue, 8 Oct 2024 14:08:14 +0200 Message-ID: <20241008115720.511212818@linuxfoundation.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241008115702.214071228@linuxfoundation.org> References: <20241008115702.214071228@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bryan O'Donoghue commit a151766bd3688f6803e706c6433a7c8d3c6a6a94 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/qcom/camss/camss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- 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_d 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_d } } - 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);