From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50AC5ECE579 for ; Mon, 9 Sep 2024 15:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pE5a5yQhNXUj5kg0rOJI8AcZQpj26NkcXlIX3jIS+TA=; b=VNsiLIUWaie4C0m8NKS5a3XWXw Mz1+3O0Yjde+FS4rzkv6C4bR6iStK9TfBj6KaSTHH4+9zMLwum9jpCcR6aaRAF7x6QYCRyilkLWY2 elU0SvjSDrd9atXmmnv1GlHvL7YV4egdo5VMZOaSSDVbB5ux3eXBg+2fdfn+np8gH5S6o4jyS/49b 1DAIA1iEuMv+ad7zFDP9blXWGOa0A7rRlAj385lz6WcSiolYb+t1NWBR0j4pmnLKezeqer+re7sNU pIj+QQvq3D8ayoOBskwQnG4ftVvZoGyHqTrMdIbQxpNzIkASB7XYS4u8//ZgO4NXErksDZVs6O93g J8w7pYXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sngiD-00000002Ymx-1RQm; Mon, 09 Sep 2024 15:53:57 +0000 Received: from mgamail.intel.com ([192.198.163.16]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snghB-00000002Ygb-2UHw; Mon, 09 Sep 2024 15:52:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725897174; x=1757433174; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=vyFxGJC2gaUCC9d9aoXJ7yEsJc3w1CNJ/3ibxlNoiew=; b=K2MK7jnN0G0UWwRI2UBmjZFfB/Rc+GGkrD+31aPpI+RAo6vPwhJ5p6s3 OrmY9OQpW3UlhsLX+oMvaUp8QMxEGBftQmxjeN3fMY2gXaIWTawirONdf 0qnPutZ2sRi5m5Psd+eupmykCa0qqCpF2V+KpE+VSLDpxrjDLDWSH1Adm Is1e4EhwktkIDGhcdj9n1AOA5FCnRuqw52ArfoAjDCh46DwSaPsorWHE/ PXDRyHM2+P+NptE2PbqFWpgrwzoq8m2cpAMg1JKoVkFt2tjN86l2a2V5F gtTd8cNTsrPX00yej3eRb0KtfqogSQ7Q79VR4DHebEWTEV62YXVSl/4js A==; X-CSE-ConnectionGUID: mDiEe8oiTgWh8pkeIMQb1w== X-CSE-MsgGUID: coc3iAGCQeyU8O7H8GGz4w== X-IronPort-AV: E=McAfee;i="6700,10204,11190"; a="13443264" X-IronPort-AV: E=Sophos;i="6.10,214,1719903600"; d="scan'208";a="13443264" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2024 08:52:49 -0700 X-CSE-ConnectionGUID: jcnxAf0PSrCL7claosPc6Q== X-CSE-MsgGUID: vTZCCGJpTG+a0ZQfIV2MIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,214,1719903600"; d="scan'208";a="67238507" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2024 08:52:45 -0700 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 2E99511F817; Mon, 9 Sep 2024 18:52:42 +0300 (EEST) Date: Mon, 9 Sep 2024 15:52:42 +0000 From: Sakari Ailus To: Laurent Pinchart Cc: Jacopo Mondi , Tomi Valkeinen , Mauro Carvalho Chehab , Raspberry Pi Kernel Maintenance , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , oe-kbuild-all@lists.linux.dev, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Naushir Patuck , Kieran Bingham , kernel test robot Subject: Re: [PATCH v4 3/4] media: raspberrypi: Add support for RP1-CFE Message-ID: References: <20240904-rp1-cfe-v4-3-f1b5b3d69c81@ideasonboard.com> <202409051822.ZzUGw3XQ-lkp@intel.com> <20240905111120.GK16183@pendragon.ideasonboard.com> <40cc1e95-b9fc-4c27-9428-1698d0bf9d25@ideasonboard.com> <763b3147-d7cb-44a7-b73b-8f7f4fd622ab@ideasonboard.com> <20240909134516.GA9448@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240909134516.GA9448@pendragon.ideasonboard.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_085253_671864_0A33FFBC X-CRM114-Status: GOOD ( 56.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Laurent, On Mon, Sep 09, 2024 at 04:45:16PM +0300, Laurent Pinchart wrote: > On Mon, Sep 09, 2024 at 03:29:30PM +0200, Jacopo Mondi wrote: > > On Mon, Sep 09, 2024 at 01:04:35PM GMT, Tomi Valkeinen wrote: > > > On 09/09/2024 12:13, Jacopo Mondi wrote: > > > > On Mon, Sep 09, 2024 at 08:22:59AM GMT, Tomi Valkeinen wrote: > > > > > On 09/09/2024 08:08, Tomi Valkeinen wrote: > > > > > > On 05/09/2024 14:11, Laurent Pinchart wrote: > > > > > > > On Thu, Sep 05, 2024 at 06:50:48PM +0800, kernel test robot wrote: > > > > > > > > Hi Tomi, > > > > > > > > > > > > > > > > kernel test robot noticed the following build warnings: > > > > > > > > > > > > > > > > [auto build test WARNING on 431c1646e1f86b949fa3685efc50b660a364c2b6] > > > > > > > > > > > > > > > > url:    https://github.com/intel-lab-lkp/linux/commits/Tomi- > > > > > > > > Valkeinen/media-uapi-Add-meta-formats-for-PiSP-FE-config-and- > > > > > > > > stats/20240904-192729 > > > > > > > > base:   431c1646e1f86b949fa3685efc50b660a364c2b6 > > > > > > > > patch link:    https://lore.kernel.org/r/20240904-rp1-cfe-v4-3- > > > > > > > > f1b5b3d69c81%40ideasonboard.com > > > > > > > > patch subject: [PATCH v4 3/4] media: raspberrypi: Add support > > > > > > > > for RP1-CFE > > > > > > > > config: m68k-allmodconfig (https://download.01.org/0day-ci/ > > > > > > > > archive/20240905/202409051822.ZzUGw3XQ-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/20240905/202409051822.ZzUGw3XQ-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 > > > > > > > > | Closes: https://lore.kernel.org/oe-kbuild- > > > > > > > > all/202409051822.ZzUGw3XQ-lkp@intel.com/ > > > > > > > > > > > > > > > > All warnings (new ones prefixed by >>): > > > > > > > > > > > > > > > > > > drivers/media/platform/raspberrypi/rp1-cfe/cfe.c:2445:12: > > > > > > > > > > warning: 'cfe_runtime_resume' defined but not used > > > > > > > > > > [-Wunused-function] > > > > > > > >      2445 | static int cfe_runtime_resume(struct device *dev) > > > > > > > >           |            ^~~~~~~~~~~~~~~~~~ > > > > > > > > > > drivers/media/platform/raspberrypi/rp1-cfe/cfe.c:2435:12: > > > > > > > > > > warning: 'cfe_runtime_suspend' defined but not used > > > > > > > > > > [-Wunused-function] > > > > > > > >      2435 | static int cfe_runtime_suspend(struct device *dev) > > > > > > > >           |            ^~~~~~~~~~~~~~~~~~~ > > > > > > > > vim +/cfe_runtime_resume +2445 > > > > > > > > drivers/media/platform/raspberrypi/ rp1-cfe/cfe.c > > > > > > > > > > > > > > The recommended way to fix this is to switch from SET_RUNTIME_PM_OPS() > > > > > > > to RUNTIME_PM_OPS() and use pm_ptr() to set .driver.pm. This being said, > > > > > > > the driver won't work on a kernel with !CONFIG_PM given how you > > > > > > > implemented probe() and remove(). > > > > > > > > > > > > > > The pisp-be driver suffered from the same issue and Jacopo fixed it in > > > > > > > the last version. You can have a look at implement something similar. > > > > > > > > > > > > I can't right away think of any reason to not just depend on CONFIG_PM > > > > > > and be done with it without any tricks. Do you know if there's a reason? > > > > > > > > We had the same discussion, and even if I would be fine depending on > > > > CONFIG_PM, supporting !CONFIG_PM is not that much work, I kept it as > > > > an optional dependency (it was suggested during the review as well) > > > > > > > > > > > > > > Also, I don't think pisp-be is correct. It just calls > > > > > pispbe_runtime_resume() in probe() to wake the IP up (which only enables > > > > > pisp clock), without telling the runtime PM about it. This means the parent > > > > > device and the suppliers may not be powered up. > > > > > > > > Are you referring to the code currently in the tree or to this patch ? > > > > https://patchwork.linuxtv.org/project/linux-media/patch/20240904095836.344833-5-jacopo.mondi@ideasonboard.com/ > > > > > > Ah, I missed that one. > > > > > > I don't think it fixes the issue I mentioned. If we have PM enabled, and the > > > parent device requires powering up for the child device (BE) to be > > > accessible, the driver will crash when calling pispbe_hw_init(). I think you > > > should call pm_runtime_set_active() before calling pispbe_runtime_resume(). > > > > As discussed, this is not a problem currently for BE, but indeed you > > have a point. > > > > Sad note: most of all the occurrences of "grep set_active" in > > drivers/media/platform/ show that set_active() is used as I've done in > > my patch > > > > > However, you said above that "supporting !CONFIG_PM is not that much work". > > > Maybe not. But how much work is it to get it right (for both PM and !PM), > > > and make sure it stays right? =). > > > > > > Just my opinion, but if there are zero use cases for the !PM, I would just > > > go with "depends on PM" to keep the driver simpler, less bug-prone, and > > > easier to maintain. > > I'm fine with that, and for platform drivers, that's my preferred > option. Sakari ? I'm concerned with your (?) recent finding that many architectures don't have support for CONFIG_PM. In this case the device is very unlikely to be used outside ARM(64) so I guess it's fine. > > > I don't see a use case for !PM and we confirmed with RPi they don't > > need to support it. During the review of a previous version of the BE > > driver iirc I've been asked to support !PM but I'm not sure I recall > > the reasons. > > I hope it wasn't me :-) Me neither. Although it'd be nice: CONFIG_PM isn't a hardware specific option as such. As one part of the kernel requires !CONFIG_PM and another CONFIG_PM, we can expect problems, at least in principle. Ideally all architectures would support it so CONFIG_PM could be removed and we could say the problem has been solved. :-) -- Regards, Sakari Ailus