Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2937791lqo; Tue, 21 May 2024 01:35:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVoWYPL2uwCFmaxbQaZA+96C8LnFgV44n2JM1OxayN4gjmM7MzSrkikkCIMUkKr4nwY4Py9CJWGOZv8U25xPdsjtIJ5Ke0xksRmjV4yaw== X-Google-Smtp-Source: AGHT+IG2TE3Ot+ymJZ0NDy1vfFPnlUyNiW3mne4cyZRkQ8hzX/M+eYzQF67qcJPop2m9rzmqaqiy X-Received: by 2002:a05:6a20:2447:b0:1af:86da:3f7 with SMTP id adf61e73a8af0-1afde0af18dmr28873903637.4.1716280536554; Tue, 21 May 2024 01:35:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716280536; cv=pass; d=google.com; s=arc-20160816; b=MLXNkz8IU5vSbI4nMO1xIjXN/V/E4hdtMWK3Yydab9Ytgr62qBjVdOTeS2ZXo70lpH b/fFY3s6jBPYa9bUkqPmTYT6tm2SzYxDaGOFSDoF8ptMljYo6uPYuSramQxHxkqfMjW2 8AOdXPZVxda09nDqUxE8JDiq4RPJmm1Rj7dPNW3bsU3J7waOkNJqZVIaRlz8LkCdqf+r hZlwW8Eo5lCuXOE+eCBoqenh5DvztdXKsYrq7sVKLj15V8kfgkxReZvdRbr2yUO3qQsR lWcIyfpx2lSGoRiML+pStlZJh5nE683chZzcNOslz4IvfgoxKnnYXLDCWSqUQiGa9efw MXIQ== 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=Sd00LK8Qnu56l+SJQzbKzwYIAmi+/e6Slk49TOoI6vs=; fh=P41ScactKO94JSCi7BGldhyal2NQGx4DsCaOEoiWLHE=; b=udxfEzurC9kbIOZRNb2qh5if9n/2XoEhM6VWwAPuv5s4MLxabpzfYpKxVVfUEf07uc zbmw5J/C+qMna91gu+f5J4ciV85kic5arQtWgMEFb9mok61Se9ox3Cl8+wq6wdUEXAKh bls8+Zhs/l8eCZ5VtzidYt9wiLxZOywHArOzWbtXYa+JIt6PPRql6UHz6tEDmTaUnXbr f86rI2FZ6sr+/cz/w4e4JF9NNgeEFf07IpUJbNOi0kL80IZw505LHUAihWu4krgbbPua u5/eLZmx8lpz9sj7rTH6DLIjuiUEC6sB7pU6mQ2GyzdB5+kkGJn58DYBAz6VLJ9H3lfu JJwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=skY3o16H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184651-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c139029si86454695ad.452.2024.05.21.01.35.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 01:35:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=skY3o16H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184651-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6AB08B20C76 for ; Tue, 21 May 2024 08:35:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3DE36CDA6; Tue, 21 May 2024 08:34:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="skY3o16H" 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 173306BFBC for ; Tue, 21 May 2024 08:34:36 +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=1716280477; cv=none; b=eqh5fiXMPum3eiGgWR4xq/mmRZJj9Lg4HzdS1nTtiskhJjZFoyiTKCocWN0uPFnHRzaAdNHziLbRaCpheig0IkooVTvdamIf8NDWgzAn0FU1FORi9L5O+vo34eB0M3FDFFMUTdxIbX/U/dlinvBia7LmEajjUDqr6tT+/2KwFYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716280477; c=relaxed/simple; bh=Sd00LK8Qnu56l+SJQzbKzwYIAmi+/e6Slk49TOoI6vs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ibk2Hs9sWd7nGIB8SJdNpWuuzQXh/5oKZBfixQNndSGKi63gsYM4lZMLcZDUAL9IG9800UYHLOC2zy2VJsTiub8td2mBvnrbqed65T9CHYV2DT5XFCg/F8GC1RH4EuIJmskOYhYM0Evx11PjY2m4GuBnQ90bcrBKjU+eGL1ZQ/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=skY3o16H; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36688C2BD11; Tue, 21 May 2024 08:34:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716280476; bh=Sd00LK8Qnu56l+SJQzbKzwYIAmi+/e6Slk49TOoI6vs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=skY3o16HDT7xZjVQpGOOMdNv8QH90+q6isn2ipNC1TxsD4EywRjVZLn/HBPj0ITHe yyEkvFkf38Zc7/LHlBKDKRPr8BYI0pgJJecqSHTWq7cQojI5RUf7u1ZjWacYjV5NeV rNOCJAH3GSVOQCKoICGDoWulDsLiVJTwcVRZ6QF6RXhUehIFBXQUWVjiu/7peDiIbQ nweYugvYv/4m+4Jnnu+AeKd3m0Fi0DJ0rZ4koCZiDfBDeY1heMj29wQ0EJ925i6L4v JXDyY/R1aconlDE8kir4ZLMCL3S24ufUZfp94f3RHnGn/leaLkUB8TjigmWvI0RzK/ 33wTVz/NI6Zxw== Date: Tue, 21 May 2024 10:34:33 +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: <20240521-arcane-husky-of-ampleness-ebad9a@houat> 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> <20240516-intrepid-uptight-tench-0df95e@penduick> 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="psxixkw5t2o4ale3" Content-Disposition: inline In-Reply-To: --psxixkw5t2o4ale3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 16, 2024 at 06:40:45PM GMT, Sui Jingfeng wrote: > Hi, >=20 > On 5/16/24 16:25, Maxime Ripard wrote: > > 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 wrot= e: > > > > > > > > > Because a lot of implementations has already added it int= o their drived > > > > > > > > > class, promote it into drm_bridge core may benifits a lot= =2E drm bridge is > > > > > > > > > a driver, it should know the underlying hardware entity. > > > > > > > > Is there some actual benefits, or is it theoretical at this= point? > > > > > > >=20 > > > > > > >=20 > > > > > > > I think, DRM bridge drivers could remove the 'struct device *= dev' > > > > > > > member from their derived structure. Rely on the drm bridge c= ore > > > > > > > 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 str= uct > > > > > > device anyway", it creates inconsistency in the API (bridges wo= uld have > > > > > > a struct device, but not other entities), and it looks like the= re's no > > > > > > use for it anyway. > > > > > >=20 > > > > > > None of these things are deal-breaker by themselves, but if the= re's only > > > > > > downsides and no upside, it's not clear to me why we should do = it at all. > > > > >=20 > > > > > It can reduce boilerplate. > > > >=20 > > > > You're still using a conditional here. > > >=20 > > > 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. > >=20 > > Sorry, I don't follow you. We can't NULL dereference a pointer that > > doesn't exist. > >=20 > > 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. >=20 > We could reduce more. But *why*? What benefit does it bring that outweights the downsides I listed earlier? > Bridge driver instances also don't have to embed 'struct i2c_client *'. We > could use 'to_i2c_client(bridge->dev)' to retrieve the pointer, > where needed. Sure, we could use a function instead of another one. But again, what benefit does that bring exactly? --psxixkw5t2o4ale3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCZkxclAAKCRAnX84Zoj2+ dofaAYDgrXduAci7FSwZj8jUaMiQ8xwaJ7bkZB6XUQuPYLVLnJDfzjop9V3uevZv KAa/xvMBf1xCT3CHjXldRWq637tJfbxrxAEbuvKz/4upaIyffiB1NMaMIRCnSH3U rsbERLOXtA== =e+Ll -----END PGP SIGNATURE----- --psxixkw5t2o4ale3--