Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp137223lqo; Thu, 16 May 2024 01:25:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW1TCa8byqgrLHC1by5hxApHhE3drZXf5HTIaRLs7Q39Y1Atxo61jg3Fv8VKcrOwr3DkYmNfO8wdTLmcnLFtbufeG/+FNXL4jzZl0FIBg== X-Google-Smtp-Source: AGHT+IHqJvlKemX6v8MXAMwC/5unHM6Hp0hgOVzs+dBlAUubBJfS0wIFeWHYp40xpDB+kAMio+sy X-Received: by 2002:a17:906:4443:b0:a59:c728:5420 with SMTP id a640c23a62f3a-a5a2d6786damr1201171666b.66.1715847918115; Thu, 16 May 2024 01:25:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715847918; cv=pass; d=google.com; s=arc-20160816; b=F+W5YR264U5cdTNI7UKHIMbZjEWHzS1PAmrV/FdEJv4JdFRBs+arsv3O542f4y97Zx Gf+6Zv+9byVA8+YyDebDB0NB4kzhGFfsetRw99ecxDNRy1jNpxuspI6nmyrQBtW9kWQI PWudHDE+XE8FALG7mysUC5fxI0JGF0LkuX9eyYkNGCAlCQeXPsk6qJsXdaT2A/0QplNO BiPxZlHBHDK27WYdF5mQpEuNVCwwDGnrYQtHBFXgc8gMOIY3qrvebHVHHrOlzsZRmAU9 s8SJ1G4cFFUh/yh57Hys0ls4s6Byy1TkjrlT/vJ5Eg5bVhh2OoyOgDpeAursBN5AMFVc 2EEA== ARC-Message-Signature: i=2; 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=wQSeNVyD2+LGMI1KSxHgOvUM6yNAJ+OyWsiLwLfXdGM=; fh=P41ScactKO94JSCi7BGldhyal2NQGx4DsCaOEoiWLHE=; b=aNSRbRsfob6Y4WeoRKX2VDAx5OcUJy6fr/7Vo/mH9/zkRYPWNg8pUea3xtYWOp/vZL HZkdUERD8CDwfoN44urKkC1ia8R6VcUaMSdQp/exxvRgvpxkUICheYQ6HLEn/mBLO1EI k3UtZb4dI+qBsVgO0LOOaOT9/HCVOaVCXwQlvtjM2LiJT/lJSk0ImFC6hmdHK5jPBLAN oIGfNsZWC9KYhk8tiHfMvGoyah1n1JI5S6Ynpqm893EzAlbLKIU5onVxE6FcMCTs+ET9 NH12xIi+Oo+RJP/6lENhxo+9J09DkePDpzOi58N/FJYayTwpN4JX3Xal0qwMhfkXuTGz Ih/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EO1cHYgc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-180757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180757-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be6951si865567566b.792.2024.05.16.01.25.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 01:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EO1cHYgc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-180757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180757-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 CB7461F22735 for ; Thu, 16 May 2024 08:25:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBA1486267; Thu, 16 May 2024 08:25:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EO1cHYgc" 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 24F3127269 for ; Thu, 16 May 2024 08:25:10 +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=1715847911; cv=none; b=KVzHJyKXKmjFQhUeXQCHuXJaza/4C7UQG0bb1QLLJ4ATMgN0NrA9SojGl2iyj6AH/Enp/+curP2Kpxc5h38/QgBuEn8zUHQ1P4/mASyM0h9qSzqq33VZgQygeabXrmuXSJQUqiRmSa6R/oQCXScQxJNzHc89cPTWe4qlxqEa2+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715847911; c=relaxed/simple; bh=wQSeNVyD2+LGMI1KSxHgOvUM6yNAJ+OyWsiLwLfXdGM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qzBtVkTGCyrneOXPHN7lTx+vapf6cuNplElkRtShrSHlngCnnxR+1uT0EeGcT7bMk5aAgJNBg5CpclfMk3HVnD+TC9V1FzMryGIbIIbPOPqoOOETjabgHGbM/u9yEpvn01C850sSJSPLtBDTq6PgBHRXLk7wcU6x3N+fr+uOjfc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EO1cHYgc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 454F1C113CC; Thu, 16 May 2024 08:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715847910; bh=wQSeNVyD2+LGMI1KSxHgOvUM6yNAJ+OyWsiLwLfXdGM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EO1cHYgcSiyEgzOkCWNMhSk9JWysjcFy/0GEKirdIi1YG5LvOa9YIyrOSEjV8FQfh 6QJdIrd4qD24cJQwdh3xVJ98gOd+lM8VXkLD5xMqY6dP44hbN79W87RoJtjjxWhkjK +EJZ9/yoZSARSObIcjh9HIYRmp0s+bruSbiUP/HikocggfO+2bSgrdVlbrxth1kltf 0RxHcmkiOevML+ju4hsLjuIUU6QtE5mwmnSMNd2Dg2ScM06zJuo6YvAB725psvuyyE 1/7E/5oO/LqIC87zin8OT1s2sX6o3ob57vgfV8zFFHkxqUSLnkKGWCFIGqKc07CChl jhAqfI+RxTpiQ== Date: Thu, 16 May 2024 10:25:07 +0200 From: Maxime Ripard To: Sui Jingfeng Cc: Neil Armstrong , Dmitry Baryshkov , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] drm/bridge: Add 'struct device *' field to the drm_bridge structure Message-ID: <20240516-intrepid-uptight-tench-0df95e@penduick> References: <20240514154045.309925-1-sui.jingfeng@linux.dev> <20240514-scarlet-corgi-of-efficiency-faf2bb@penduick> <20240515-fair-satisfied-myna-480dea@penduick> <20240515-copper-chimpanzee-of-fortitude-ff3dab@penduick> <2c15c859-6b2b-4979-8317-698bf6cc430c@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha384; protocol="application/pgp-signature"; boundary="toq7dtu3l53x2mb5" Content-Disposition: inline In-Reply-To: <2c15c859-6b2b-4979-8317-698bf6cc430c@linux.dev> --toq7dtu3l53x2mb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2024 at 11:19:58PM +0800, Sui Jingfeng wrote: > Hi, >=20 >=20 > On 5/15/24 22:58, Maxime Ripard wrote: > > On Wed, May 15, 2024 at 10:53:00PM +0800, Sui Jingfeng wrote: > > > On 5/15/24 22:30, Maxime Ripard wrote: > > > > On Wed, May 15, 2024 at 12:53:33AM +0800, Sui Jingfeng wrote: > > > > > On 2024/5/15 00:22, Maxime Ripard wrote: > > > > > > Hi, > > > > > >=20 > > > > > > On Tue, May 14, 2024 at 11:40:43PM +0800, Sui Jingfeng wrote: > > > > > > > Because a lot of implementations has already added it into th= eir drived > > > > > > > class, promote it into drm_bridge core may benifits a lot. dr= m bridge is > > > > > > > a driver, it should know the underlying hardware entity. > > > > > > Is there some actual benefits, or is it theoretical at this poi= nt? > > > > >=20 > > > > >=20 > > > > > I think, DRM bridge drivers could remove the 'struct device *dev' > > > > > member from their derived structure. Rely on the drm bridge core > > > > > when they need the 'struct device *' pointer. > > > >=20 > > > > Sure, but why do we need to do so? > > > >=20 > > > > The other thread you had with Jani points out that it turns out that > > > > things are more complicated than "every bridge driver has a struct > > > > device anyway", it creates inconsistency in the API (bridges would = have > > > > a struct device, but not other entities), and it looks like there's= no > > > > use for it anyway. > > > >=20 > > > > None of these things are deal-breaker by themselves, but if there's= only > > > > downsides and no upside, it's not clear to me why we should do it a= t all. > > >=20 > > > It can reduce boilerplate. > >=20 > > You're still using a conditional here. > > It's for safety reason, prevent NULL pointer dereference. > drm bridge can be seen as either a software entity or a device driver. >=20 > It's fine to pass NULL if specific KMS drivers intend to see > drm bridge as a pure software entity, and for internal use only. > Both use cases are valid. Sorry, I don't follow you. We can't NULL dereference a pointer that doesn't exist. Please state why we should merge this series: what does it fix or improve, aside from the potential gain of making bridges declare one less pointer in their private structure. Maxime --toq7dtu3l53x2mb5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCZkXC4wAKCRAnX84Zoj2+ duwLAYDJLwwZxC6nv2o6co5SHZA890EEJ4sBl7/6pKRAdMofidpb1VuuXsFJ6wuy 1mwpPikBfjwAVJvlg/Adew0kmxARdh6BhgjhM8/XpUlkME8b39Me89obXMSOJ3U7 iPUlp/ORmQ== =JFrx -----END PGP SIGNATURE----- --toq7dtu3l53x2mb5--