Message ID | 20240826144338.463683-5-jacopo.mondi@ideasonboard.com (mailing list archive) |
---|---|
State | Superseded |
Headers |
Received: from ny.mirrors.kernel.org ([147.75.199.223]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <linux-media+bounces-16825-patchwork=linuxtv.org@vger.kernel.org>) id 1siaxK-0004n4-1h for patchwork@linuxtv.org; Mon, 26 Aug 2024 14:44:36 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A020F1C21C1A for <patchwork@linuxtv.org>; Mon, 26 Aug 2024 14:44:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2862618D65C; Mon, 26 Aug 2024 14:44:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="V6Vj206Y" X-Original-To: linux-media@vger.kernel.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 5F0AD1925A4 for <linux-media@vger.kernel.org>; Mon, 26 Aug 2024 14:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724683449; cv=none; b=sijyhR2AtKCRcL/1pDIpLJq0/Rsv0mCZ921WqpjuNRtrvzuDLN0NxHJuewEpuYCMI0qNMIGeZUraQMK+ns3H4vTLPC/eXx//EjsstKsPcxTO/yjTXNnlDjZnSlEsZWLZ6/u4KLhMKP9ksPYCcPW4VXpH2MwrHOW0sEuyicP54/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724683449; c=relaxed/simple; bh=pZV1epGz/wTS1hfjeW2geB4ciytD9LN/DMC0xOZO8Mw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p+KPQvN03JZXsy8cuXNNrRlFBgOWb6ej5GMD5PN42ehnCSoJ7AFOov02233QNPfW6l/Urq75Fz1ufLiPV39UFilyp3xRYiqTjnzn8MSsDtiRY4R5R12R62RU6uZEAO5787kLK0ruvJbiN2AadE5fR8IENQIKmuNUevHbJOcYfO0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=V6Vj206Y; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from ideasonboard.com (mob-5-90-142-90.net.vodafone.it [5.90.142.90]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DC6D9A8F; Mon, 26 Aug 2024 16:42:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1724683377; bh=pZV1epGz/wTS1hfjeW2geB4ciytD9LN/DMC0xOZO8Mw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V6Vj206YITen4eMqbRamPzs84dStSBV75Cl0SXgWC7duuOuNETf6v1pTJggmSigDr 813BxjQGHSaMYeH071Z2NdgZHx7rpjwG99yn9Yw/PCN06dlwbfRRLLGULEEjeecn1S sK7wz1TzkXvCXsiERmvElw2I6CUleJbny1oe9eTE= From: Jacopo Mondi <jacopo.mondi@ideasonboard.com> To: Naushir Patuck <naush@raspberrypi.com>, Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>, David Plowman <david.plowman@raspberrypi.com>, Dave Stevenson <dave.stevenson@raspberrypi.com>, Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Jacopo Mondi <jacopo.mondi@ideasonboard.com>, linux-media@vger.kernel.org Subject: [PATCH 4/4] media: pisp_be: Fix pm_runtime underrun in probe Date: Mon, 26 Aug 2024 16:43:37 +0200 Message-ID: <20240826144338.463683-5-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240826144338.463683-1-jacopo.mondi@ideasonboard.com> References: <20240826144338.463683-1-jacopo.mondi@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: <linux-media.vger.kernel.org> List-Subscribe: <mailto:linux-media+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-media+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-LSpam-Score: -6.3 (------) X-LSpam-Report: No, score=-6.3 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_MISSING=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_VALIDITY_CERTIFIED=-3,RCVD_IN_VALIDITY_RPBL=1.31,RCVD_IN_VALIDITY_SAFE=-2,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no |
Series | media: pisp-be: Split jobs creation and scheduling | |
Commit Message
Jacopo Mondi
Aug. 26, 2024, 2:43 p.m. UTC
The pisp_be driver uses and depends on runtime_pm.
During the probe() routine, the driver needs to power up the interface
in order to identify and initialize the hardware and it later suspends
it at the end of probe().
The driver erroneously resumes the interface by calling the
pispbe_runtime_resume() function directly, without going
through the pm_runtime helpers, but later suspends it by calling
pm_runtime_put_autosuspend().
This causes a PM usage count imbalance at probe time, notified by the
runtime_pm framework with the below message in the system log:
pispbe 1000880000.pisp_be: Runtime PM usage count underflow!
Fix this by resuming the interface using the pm runtime helpers instead
of calling the resume function directly.
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
drivers/media/platform/raspberrypi/pisp_be/pisp_be.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Jacopo,
kernel test robot noticed the following build warnings:
[auto build test WARNING on media-tree/master]
[also build test WARNING on linus/master v6.11-rc5 next-20240826]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jacopo-Mondi/media-pisp_be-Drop-reference-to-non-existing-function/20240826-224625
base: git://linuxtv.org/media_tree.git master
patch link: https://lore.kernel.org/r/20240826144338.463683-5-jacopo.mondi%40ideasonboard.com
patch subject: [PATCH 4/4] media: pisp_be: Fix pm_runtime underrun in probe
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20240827/202408271258.YcqkRjNU-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240827/202408271258.YcqkRjNU-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408271258.YcqkRjNU-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/media/platform/raspberrypi/pisp_be/pisp_be.c:1641:12: warning: 'pispbe_runtime_resume' defined but not used [-Wunused-function]
1641 | static int pispbe_runtime_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~
vim +/pispbe_runtime_resume +1641 drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1640
12187bd5d4f8c1 Naushir Patuck 2024-06-26 @1641 static int pispbe_runtime_resume(struct device *dev)
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1642 {
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1643 struct pispbe_dev *pispbe = dev_get_drvdata(dev);
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1644 int ret;
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1645
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1646 ret = clk_prepare_enable(pispbe->clk);
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1647 if (ret) {
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1648 dev_err(dev, "Unable to enable clock\n");
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1649 return ret;
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1650 }
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1651
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1652 dev_dbg(dev, "%s: Enabled clock, rate=%lu\n",
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1653 __func__, clk_get_rate(pispbe->clk));
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1654
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1655 return 0;
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1656 }
12187bd5d4f8c1 Naushir Patuck 2024-06-26 1657
diff --git a/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c b/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c index f42541bb4827..fd4fec0f5d99 100644 --- a/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c +++ b/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c @@ -1741,7 +1741,7 @@ static int pispbe_probe(struct platform_device *pdev) pm_runtime_use_autosuspend(pispbe->dev); pm_runtime_enable(pispbe->dev); - ret = pispbe_runtime_resume(pispbe->dev); + ret = pm_runtime_resume_and_get(pispbe->dev); if (ret) goto pm_runtime_disable_err;