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 8A8CDC28B23 for ; Fri, 7 Mar 2025 13:40:38 +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:MIME-Version:In-Reply-To: Content-Type:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z4Fwuntd5k4pzx4sjSOCt+EHZTrpZASJNn/tK0Fdke0=; b=YfR8kTfphFgTfIBPD3mtm5o15U +YbeB7/953ZmD2PbFRcAJBYqLkCc1I6uVgmMX2n2fkX+sB+O+W+6NAzzx+o2UR2KzyKC+lpUWElXo cD6XdGwYpSk+t3fxz4NtHN3GV5opOBKbglDc6dB0S0UEpJ6QrtX05Du7mkoBfId9r0QjHx7Vcy8nL JkpkC5XdmyzeGsk4fc6UFRNv8/bm6vFXKDtafjsTptiPnhS1d931VsiNU2LSxr4KG8OoJkLM8ZpRC HTOIotwZojk9OTTcQejDyavx1o4OQoHAh3sxZcwPdM78FFxk/9ALSkPEarpW40E1p+x22rxJUUcXj bhZ+1eMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tqXwD-0000000EM34-1qaC; Fri, 07 Mar 2025 13:40:29 +0000 Received: from mail-vi1eur03on2062a.outbound.protection.outlook.com ([2a01:111:f403:260c::62a] helo=EUR03-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tqXuW-0000000ELrs-0Ozj for linux-arm-kernel@lists.infradead.org; Fri, 07 Mar 2025 13:38:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jv9tkyL/K6ObTRcFjbkFf0EkizbupqtwUaEMLS4ov6+WHEKvuQDxhSm9AYKGV42j7qPaJ5xVhTsF7BrqOp/c/51e0yCbjfNsavu8hl/apsPsrqPYiZUqCGkk6toGyejyUTMtRtkLfduic6tQ39rksB/aIKYn0co7Kxc2jhAa9Kf1DlTPWasFrUVVSBt1z1fmfvJEwy7YJJoh9rT2YvQ0Mh4XcRB6ibBnDHXpAQuydeilmeK95CG9u5IDgfeV1+Cp/GECJibP74kr78KHE39YWROc+CGZInvNZYgwlf+3S+azmHmpCNT8GJyyAnRp59c4XGbF4DGvXa4ZmkQP7dsh2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z4Fwuntd5k4pzx4sjSOCt+EHZTrpZASJNn/tK0Fdke0=; b=gEDUvpq4qNJiEcX/A3epiigCAYetMLyqCv1K6pG6gt6iu/GPeiUo/RtLc6cZ37G8Rx39NPQW0A+JdtBPk9qS+qy1hUpyToOHHwXl0Oy1LSpqfI9Dis4mY12nBk+yQCIfL6lx67AdjIBQ7lHMHUILOFJSi97vMvgysxkc/3KSfSpT+MZdhdpOFfqHGQKl+Y8z7OfUJPQh12ACzTou9Zma0AeNBxHM3M9BJI/tOZPCu6vGKEquBdtAVVCOJOUHqJ4/Ar/3EIM3uFK1V9wzvXwrBEaRmhyCjc8IHHHCKaEgWSDY3jh+ZckAKU3jIguapVFTPj/8CJ2DJrJXivx299FpjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z4Fwuntd5k4pzx4sjSOCt+EHZTrpZASJNn/tK0Fdke0=; b=cKXQdUKO15Wy6l0wWuqABFgmAUUUbvfBRk5HpBbmox5Lx/8Q4hsw7mWfmnaaAFfz8ILphMQ2lUrWu/G4HX6+RLCxCkLVBWFdDi6Y7enz3RqUaS2TKNPfuHK1/8At+hp+IlgzKgkgfq1l4ZbkbCaQfkHtI4ZyByvH2zDgOx2GEIKwT6qbTWq4J0UcXcAM5j2jhrOg6h8RmrFrm8LZtdghqHjiHxliNAIk032D1OH0UIiMd8ewNl2c9yaydE6ic72KrkBJCTzlKyrEwEhEWndLbuzlkULl5veWqVJXW0u17ARescFgFj4MOEwljnKOu/wobPIXieWcEOJAPV5/k/mZLw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) by VI1PR03MB6431.eurprd03.prod.outlook.com (2603:10a6:800:195::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8511.17; Fri, 7 Mar 2025 13:38:35 +0000 Received: from DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf]) by DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf%7]) with mapi id 15.20.8511.017; Fri, 7 Mar 2025 13:38:35 +0000 Date: Fri, 7 Mar 2025 14:38:29 +0100 From: Mathis Foerst To: Sakari Ailus Cc: Dan Carpenter , linux-kernel@vger.kernel.org, Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, manuel.traut@mt.com, mathis.foerst@zuehlke.com Subject: Re: [PATCH v1 1/1] media: imx: csi: Parse link configuration from fw_node Message-ID: References: <20250305113802.897087-1-mathis.foerst@mt.com> <20250305113802.897087-2-mathis.foerst@mt.com> <84aa2d87-d7f1-46c9-b28d-6f0e9a78788d@stanley.mountain> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: ZR2P278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::7) To DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB10396:EE_|VI1PR03MB6431:EE_ X-MS-Office365-Filtering-Correlation-Id: cf480bc9-5d7f-47d7-0259-08dd5d7d5c29 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?1LIpBUXSfHVpWS3TKq9SkxfE+H1KeBQrJ+0+2QwNNgfgEnPXvwcWAL3QBzE8?= =?us-ascii?Q?1LFOx9mxB7aB+cCjm1xS2kGjKkdH2pDhM+5RfEX8WzUYG/HH+qwuyKq5qV6h?= =?us-ascii?Q?53gGU3j9Y4oPk36PIwNHQktg1K+D8TJ9OdXNIBPD85b5CVRtxWAgDHAw1lSP?= =?us-ascii?Q?cYpsWu8LmjpU0FabLX25KcbtfXjIW1ZRBCOzvMqyL0OxbFtNbQZYBUuUk6I7?= =?us-ascii?Q?a7itT+qZzeP2PZe8MoOVmpdSm9XJYxdWzIB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-ascii?Q?JgUnZ4EmxGuR8fuBQrv32n75bxmTmCktznOBsH7eg+oeKWlv5URES/l6B1kM?= =?us-ascii?Q?8BVEb8cu2rE7vMldZOHFpTvzgq9as50Eo4cvsdHhg1Dmh9sJbAu6bj7j9t2P?= =?us-ascii?Q?Q9rPRZK0Rlk9JEcwvr+HoshxTb/BwDhff5JpZFmo9o9a/LEUVBLAqr4wh6Mo?= =?us-ascii?Q?q8tf325g0rvb91RIiZjVrmyP+nuv1CWsjKSJoNTDN+RKqjpVQ9b3fxWEE/2o?= =?us-ascii?Q?6+nYnPDCR2c3FHhbfQL00F3QKxplhak1Xhf8WdltZDMapQ2axZtqcJfCiGUP?= =?us-ascii?Q?tKjP6lL4aLSU+wVBFP81QORAoEhPOyRh?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB10396.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(52116014)(376014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?onBAQfV9YLLW/a0SVS/OZmyPwv3KJgCA3Exymbgq3+Kj6yPbRidLtlqcDvTj?= =?us-ascii?Q?qq9vtgGACJJTeB2n7JRCwR/oGgpqXYs2kdr+AJRhZkmijQ1qXKj8QvcTV1+N?= =?us-ascii?Q?E5aRFGiEy49Z9UezsypvEpi7cZb4aNuZWmaUo3G2bwAvRYQ37xJqPy/7lzK/?= =?us-ascii?Q?XUY1S38Kdgmpw87hTbunIFID/jDsG5alyPb1/8k6Pat9t0tLKuVcyIIGqGRw?= =?us-ascii?Q?aOlvHBwt0PZZc1gfs1JVieFl+sE6yoO8W5b3ZSq1mnvBuZwSENmADxSjb17l?= =?us-ascii?Q?MU+ia4gb2YLfQY0KzQ1dLn6zaTPeFUOe8YajvcGi9ayw9I4G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7iJUZWWVKz+bs6LY9ryYoJL/dm3Abt?= =?us-ascii?Q?sBrkP+V/X2wmJA76XBLGfKOnERo37/n5vr/4Vptc+kSfKShiBFSZ3QViC4tZ?= =?us-ascii?Q?2SFCRg+OLUIIVC7FcFD1t8rfrRe5wZj7v6yapuDcKp+6jSykgoKK/aQvXUDi?= =?us-ascii?Q?gERKRVkFaSfcfK+5KoFOYTNNSyVpHUqJK9YFs6RjQS3SJSPO4ItLVpWZ5as5?= =?us-ascii?Q?uizq40JmkH7MuR4pEO3p+A0Qa9vroyhunOcTeVmjUyP5oh+XTpJycgMAmcvw?= =?us-ascii?Q?IqsHNo+N7UES+LigYwgxgxzkEVIiy11ejDyADc3PQBV0eAXLaDtJG2pkeIiW?= =?us-ascii?Q?8EBbLchs/BvCCmq+vDaqaoafx14O1VuAmgdVv7bZ?= X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf480bc9-5d7f-47d7-0259-08dd5d7d5c29 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB10396.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2025 13:38:35.7443 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mWOYyKQ74/2X7NBB/B6cxETzpBEiOdbPStqvdZlePh3Zkcj6NidP3bIGz3WoFIPe+asgThoVrcZPxrKZa0Yk/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6431 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250307_053844_612296_2548799B X-CRM114-Status: GOOD ( 49.36 ) 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 Sakari, Hi Dan, thanks a lot for your feedback. On Thu, Mar 06, 2025 at 09:13:46PM +0000, Sakari Ailus wrote: > Hi Dan, > > On Thu, Mar 06, 2025 at 10:07:20PM +0300, Dan Carpenter wrote: > > On Thu, Mar 06, 2025 at 04:33:18PM +0000, Sakari Ailus wrote: > > > Hi Mathis, > > > > > > Thanks for the patch. > > > > > > On Wed, Mar 05, 2025 at 12:38:02PM +0100, Mathis Foerst wrote: > > > > The imx-media-csi driver requires upstream camera drivers to implement > > > > the subdev-pad-op "get_mbus_config" [0]. Camera drivers that don't > > > > implement this function are not usable on the i.MX6. > > > > > > > > The docs for get_mbus_config [1] say: > > > > @get_mbus_config: get the media bus configuration of a remote sub-device. > > > > The media bus configuration is usually retrieved from the > > > > firmware interface at sub-device probe time, immediately > > > > applied to the hardware and eventually adjusted by the > > > > driver. > > > > > > > > Currently, the imx-media-csi driver is not incorporating the information > > > > from the firmware interface and therefore relies on the implementation of > > > > get_mbus_config by the camera driver. > > > > > > > > To be compatible with camera drivers not implementing get_mbus_config > > > > (which is the usual case), use the bus information from the fw interface: > > > > > > > > The camera does not necessarily has a direct media bus link to the CSI as > > > > the video-mux and/or the MIPI CSI-2 receiver of the i.MX6 might be in > > > > between them on the media pipeline. > > > > The CSI driver already implements the functionality to find the connected > > > > camera sub-device to call get_mbus_config on it. > > > > > > > > At this point the driver is modified as follows: > > > > In the case that get_mbus_config is not implemented by the upstream > > > > camera, try to get its endpoint configuration from the firmware interface > > > > usign v4l2_fwnode_endpoint_parse. > > > > For the supported mbus_types (V4L2_MBUS_PARALLEL, V4L2_MBUS_BT656 and > > > > V4L2_MBUS_CSI2_DPHY), extract the mbus_config from the endpoint > > > > configuration. > > > > For all other mbus_types, return an error. > > > > > > > > Note that parsing the mbus_config from the fw interface is not done during > > > > probing because the camera that's connected to the CSI can change based on > > > > the selected input of the video-mux at runtime. > > > > > > > > [0] drivers/staging/media/imx/imx-media-csi.c - line 211..216 > > > > [1] include/media/v4l2-subdev.h - line 814 > > > > > > > > Signed-off-by: Mathis Foerst > > > > --- > > > > drivers/staging/media/imx/imx-media-csi.c | 36 ++++++++++++++++++++--- > > > > 1 file changed, 32 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c > > > > index 3edbc57be2ca..394a9321a10b 100644 > > > > --- a/drivers/staging/media/imx/imx-media-csi.c > > > > +++ b/drivers/staging/media/imx/imx-media-csi.c > > > > @@ -169,6 +169,8 @@ static int csi_get_upstream_mbus_config(struct csi_priv *priv, > > > > { > > > > struct v4l2_subdev *sd, *remote_sd; > > > > struct media_pad *remote_pad; > > > > + struct fwnode_handle *ep_node; > > > > + struct v4l2_fwnode_endpoint ep = { .bus_type = 0 }; > > > > > > Are there any defaults in DT bindings (other than 0's)? Also initialising a > > > field to zero this way is redundant, just use {}. > > > > > > > I was going to respond in much the same way. This is equivalen to: > > > > struct v4l2_fwnode_endpoint ep = { .bus_type = V4L2_MBUS_UNKNOWN }; > > Thinking about this in a context of parsing the endpoint, in fact the > bus_type should be specified. Presumably the hardware is D-PHY, so the > correct value would be V4L2_MBUS_CSI2_DPHY. This way > v4l2_fwnode_endpoint_parse() doesn't need to guess. I think we must use "bus_type = V4L2_MBUS_UNKNOWN" here: The i.MX6 has two types of camera interfaces: Parallel and MIPI CSI-2. They are connected either directly or via a video-mux to the CSIs (See IMX6DQRM.pdf - Figure 9-3 for the connection diagram) Pre-defining V4L2_MBUS_CSI2_DPHY here would let v4l2_fwnode_endpoint_parse() fail if the camera uses the parallel bus. We could distinguish between MIPI CSI-2 and Parallel input by checking the grp_id of the upstream device like it's already done in csi_get_upstream_mbus_config(). But for the Parallel case we still can't know if we should set bus_type to V4L2_MBUS_PARALLEL or to V4L2_MBUS_BT656 - the i.MX6 supports both formats on the parallel interface. That's why I would argue that v4l2_fwnode_endpoint_parse() must figure out the bus_type from the fw node. > > > > > > > int ret; > > > > > > > > if (!priv->src_sd) > > > > @@ -210,11 +212,37 @@ static int csi_get_upstream_mbus_config(struct csi_priv *priv, > > > > > > > > ret = v4l2_subdev_call(remote_sd, pad, get_mbus_config, > > > > remote_pad->index, mbus_cfg); > > > > - if (ret == -ENOIOCTLCMD) > > > > - v4l2_err(&priv->sd, > > > > - "entity %s does not implement get_mbus_config()\n", > > > > - remote_pad->entity->name); > > > > + if (ret == -ENOIOCTLCMD) { > > > > > > if (!ret) > > > return 0; > > > > > > And you can unindent the rest. > > > > I was going to say this too but then I thought actually this needs to > > be: > > > > if (ret != -ENOIOCTLCMD) > > return ret; > > > > Which is weird. Better to break all the new code into a separate > > helper function. > > > > if (ret == -ENOIOCTLCMD) > > ret = parse_fw_link_config_stuff(); > > > > return ret; Good point. I factored out a helper function as suggested. > > Indeed. get_mbus_config() presumably wouldn't return an error but > correctness is usually a good idea. > > -- > Regards, > > Sakari Ailus Best regards, Mathis Foerst