Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8063942rdb; Thu, 4 Jan 2024 18:19:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNFcvmzO8GX5/P3iPOfczhgGF+pJDBNSFDNnDTAdkDUeJPocXUBd+7cgVttxFATLLQP4BN X-Received: by 2002:a17:907:1de7:b0:a27:914d:4b76 with SMTP id og39-20020a1709071de700b00a27914d4b76mr378370ejc.12.1704421180855; Thu, 04 Jan 2024 18:19:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704421180; cv=none; d=google.com; s=arc-20160816; b=FYwTbZIOMKUP/td2S67B9qUM5FmZzNeMdWET9A32ps3UYGAMFzgYRGS4PpjfAf5wxr PCkKBaVYHC22rlXbEyGnfGOYtcK0kgFMbJ6lkjt+zNgY5FbQPzbBAy7jmD1zifFseb53 kaghWKFA+kHuP6KOyn/KkSsQOlI3DvH0OyABwmQVUd3hmbPE46Z4xGwUvSk6te8aDAYE f6nbRsu91StauFTeaqyPBzEsSNnkEHT7229SJt1QwGslU0R5BoXu7z6pRdocwDen1S7I KhrDrkaQsJ+qfaD3v+shRiBhBuVnrR1GvV6wgl+jTt6BYK1dpuOkrubMsIBeuxbPRS3X cs4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PtFtZ+5mwnqDmafnvGk1KxVAkboQiwGd/FdiEdjKkj8=; fh=dsBV5XFCLOiIcJOmIVREJNul1aVGwdsQl9dRhWDAhqE=; b=itjrLO/MaNexySk3HVBfEfdV5rbNu9F9+jQPq8pP1JOS8X/pSq/gFDEnbkqR3oQfJ5 E3pFUSyLKvtcBZWMtM82qvLy4dyak40aU8kl/6yZx6/Mi+/l4ctrlBSW2NYP5HJQn1Td LqjNE8+day8J0knYvexZ5FQrhkLkSblNmDK/W+Iej/Wle7BeUurteNWe9ACsfeLyZEAX GrP55EDXrPabOp0dbdHR839JucAbTlsSAVmLZIzFfbdrlExZ/PvEVAX48U8jo76ME9QT 69ZKNLUSeP1xggFRCUXhZNY8O5pjUSjSoNwGsz0X2PHezwsXN7Claslgh/TWFgABC+G8 lFYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RaESA5lq; spf=pass (google.com: domain of linux-kernel+bounces-17413-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17413-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n16-20020a170906119000b00a27dca0384csi214108eja.385.2024.01.04.18.19.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 18:19:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17413-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RaESA5lq; spf=pass (google.com: domain of linux-kernel+bounces-17413-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17413-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 939081F2277C for ; Fri, 5 Jan 2024 02:19:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47585210D; Fri, 5 Jan 2024 02:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RaESA5lq" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39A931FD1 for ; Fri, 5 Jan 2024 02:19:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6d9b51093a0so841778b3a.0 for ; Thu, 04 Jan 2024 18:19:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1704421167; x=1705025967; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PtFtZ+5mwnqDmafnvGk1KxVAkboQiwGd/FdiEdjKkj8=; b=RaESA5lqe8He9A76Egp038uKQ9DFcOnZl9prGmaAoGwFObDmcpFjGzozl3TwmsM1/s 0724wrR9ir8/16VftOFCjUU6QrTvCTIZCz+ZQTR9MjCeKHhc1/+qDMc7IfCYywCrw3l5 JJAq/3FzFc82TwJ/wubOReZSBTyjqedICKPj4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704421167; x=1705025967; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PtFtZ+5mwnqDmafnvGk1KxVAkboQiwGd/FdiEdjKkj8=; b=vjB9KZppq8aB66uHG1CtX5v0UplKOf4CD2MjLw+Clk2yelh64O9nG8Z0CawrFP8bds Ksd2RDWxgYYm9vWwozflxyc20BupTerLG40NKLUNjJZ1IhwvvSzDxx1BQsb1Rh25gmwx jC5G/+xrw/TuCTL0Ks8PAkC2YdPz3XciaOCpbwb46H08f3hdKd6JBQSLTpXinNaPmaeZ P0HPvCpU8PydTqeXDJNFGsARscMZVhMudwOfbjEN5xqIEZCHGZKchEXBPFeJsMg2DNL3 Hm6srkhoOCNqItKiPPWA4gIdw/hUhCU3at5az8C7wK9J7MrFY8CUV5KEGEP85kkoVrAe KnhQ== X-Gm-Message-State: AOJu0YwIR+QwFdE4uzDR69YGZdTqF5h8gO9vwt9bh+Vxt8VpY7IAY/6n shMLfDCZZMr7xAYACTihGxd/I3HWQNjL X-Received: by 2002:aa7:8896:0:b0:6d9:c201:66f0 with SMTP id z22-20020aa78896000000b006d9c20166f0mr1472598pfe.27.1704421167568; Thu, 04 Jan 2024 18:19:27 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:65cf:cf74:4dbc:9e23]) by smtp.gmail.com with ESMTPSA id w9-20020a63d749000000b005cdf9c8e922sm339313pgi.85.2024.01.04.18.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 18:19:26 -0800 (PST) Date: Fri, 5 Jan 2024 11:19:23 +0900 From: Hidenori Kobayashi To: Dan Carpenter Cc: Sakari Ailus , Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: staging: ipu3-imgu: Set fields before media_entity_pads_init() Message-ID: <20240105021856.wpzmwtyzxzqfznrp@google.com> References: <20231228093926.748001-1-hidenorik@chromium.org> <27f1c487-78cc-4e56-ba79-1434aba131fd@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27f1c487-78cc-4e56-ba79-1434aba131fd@moroto.mountain> On Thu, Jan 04, 2024 at 01:04:27PM +0300, Dan Carpenter wrote: > On Thu, Dec 28, 2023 at 06:39:25PM +0900, Hidenori Kobayashi wrote: > > The pad's flags is checked in media_entity_pads_init(), so it has to be > > initialized beforehand. The ops initialization is also moved together > > for readability. > > > > How does this bug look like to a user? What is the Fixes tag? Does > this need to be backported to stable? I suppose I should have included those in the commit message. 1) To a user, the imgu driver fails to probe with the following message: [ 14.596315] ipu3-imgu 0000:00:05.0: failed initialize subdev media entity (-22) [ 14.596322] ipu3-imgu 0000:00:05.0: failed to register subdev0 ret (-22) [ 14.596327] ipu3-imgu 0000:00:05.0: failed to register pipes (-22) [ 14.596331] ipu3-imgu 0000:00:05.0: failed to create V4L2 devices (-22) 2) Re Fixes tag, I see that the first commit of imgu driver already initializes the flags after media_entity_pads_init(). The documentation of this API ( "Drivers must set the direction of every pad ... before calling media_entity_pads_init") predates the first commit. So, I guess Fixes: a0ca1627b450 ("media: staging/intel-ipu3: Add v4l2 driver based on media framework") 3) Re stable, I was not sure. The probe failure only appears after a check was added by Commit deb866f9e3a45ae058b21765feeffae6aea6a193. That check is not in linux-6.6.y branch. So I was not sure if this counts as "a real bug that bothers people" mentioned in the document. With the above, how does the following sounds to you? The imgu driver fails to probe because it does not set the pad's flags before calling media_entity_pads_init(). Fix the initialization order so that the driver probe succeeds. The ops initialization is also moved together for readability. Fixes: a0ca1627b450 ("media: staging/intel-ipu3: Add v4l2 driver based on media framework") Thanks for the guidance, Hidenori