From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751156AbdGNXBW (ORCPT ); Fri, 14 Jul 2017 19:01:22 -0400 Received: from anholt.net ([50.246.234.109]:37456 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbdGNXBV (ORCPT ); Fri, 14 Jul 2017 19:01:21 -0400 From: Eric Anholt To: Archit Taneja , Andrzej Hajda , dri-devel@lists.freedesktop.org, Laurent Pinchart , Thierry Reding Cc: linux-kernel@vger.kernel.org, Boris Brezillon Subject: Re: [PATCH 6/8] drm: Allow DSI devices to be registered before the host registers. In-Reply-To: <37d3cc1b-a27a-9dba-4bec-2d06bea33858@codeaurora.org> References: <20170627195839.3338-1-eric@anholt.net> <20170627195839.3338-7-eric@anholt.net> <6fbaa797-1040-48e8-c361-dad4363cd30d@codeaurora.org> <37d3cc1b-a27a-9dba-4bec-2d06bea33858@codeaurora.org> User-Agent: Notmuch/0.22.2+1~gb0bcfaa (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 14 Jul 2017 16:01:18 -0700 Message-ID: <87shhy7hdt.fsf@eliezer.anholt.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Archit Taneja writes: > On 06/29/2017 04:09 PM, Andrzej Hajda wrote: >> On 29.06.2017 07:03, Archit Taneja wrote: >>> >>> On 06/28/2017 01:28 AM, Eric Anholt wrote: >>>> When a mipi_dsi_host is registered, the DT is walked to find any child >>>> nodes with compatible strings. Those get registered as DSI devices, >>>> and most DSI panel drivers are mipi_dsi_drivers that attach to those n= odes. >>>> >>>> There is one special case currently, the adv7533 bridge, where the >>>> bridge probes on I2C, and during the bridge attach step it looks up >>>> the mipi_dsi_host and registers the mipi_dsi_device (for its own stub >>>> mipi_dsi_driver). >>>> >>>> For the Raspberry Pi panel, though, we also need to attach on I2C (our >>>> control bus), but don't have a bridge driver. The lack of a bridge's >>>> attach() step like adv7533 uses means that we aren't able to delay the >>>> mipi_dsi_device creation until the mipi_dsi_host is present. >>>> >>>> To fix this, we extend mipi_dsi_device_register_full() to allow being >>>> called with a NULL host, which puts the device on a queue waiting for >>>> a host to appear. When a new host is registered, we fill in the host >>>> value and finish the device creation process. >>> This is quite a nice idea. The only bothering thing is the info.of_node= usage >>> varies between child nodes (mipi_dsi_devs) and non-child nodes (i2c con= trol >>> bus). >>> >>> For DSI children expressed in DT, the of_node in info holds the DT node >>> corresponding to the DSI child itself. For non-DT ones, this patch assu= mes >>> that info.of_node stores the DSI host DT node. I think it should be oka= y as >>> long as we mention the usage in a comment somewhere. The other option i= s to >>> have a new info.host_node field to keep a track of the host DT node. >>=20 >> Field abuse is not a biggest issue. >>=20 >> This patch changes totally semantic of mipi_dsi_device_register_full. >> Currently semantic of *_device_register* function is to create and add >> device to existing bus, ie after return we have device attached to bus, >> so it can be instantly used. With this change function can return some >> unattached device, without warranty it will be ever attached - kind of >> hidden deferring. Such change looks for me quite dangerous, even if it >> looks convenient in this case. >>=20 >> As discussed in other thread more appealing solution for me would be: >> 1. host creates dsi bus, but doesn't call component_add as it does not >> have all required resources. >> 2. host waits for all required dsi devs attached, gets registered panels >> or bridges and calls component_add after that. >> 3. in bind phase it has all it needs, hasn't it? > > This seems like it would work, but would require KMS drivers to restructu= re > themselves around this approach. For KMS drivers that don't even use the > component stuff, it might be asking too much. > > We could maybe consider Eric's patch as an intermediate solution, we shou= ld > definitely put WARN_ON(!dsi->host) like checks for all the existing > mipi_dsi_*() API. Could you clarify which entrypoints you'd like a warning on? Is it just "everything that gets the host ops"? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAllpTT4ACgkQtdYpNtH8 nuj00w//b7wZKT2YkGBP2jwciRnpsy/B3GjIhMSAi/MvWmCxL3gukU5mUqsPYAvd yxcHYR6oQP6WuOuFYuZjJIAVJqNraoTWQCuvROC7lEe9O9ZHwERVEvTnQG2/m5n9 VXifqbsxyDdEJ27xzbHArZh9EYaZWPwNQjMQU54j4GTseuJ6a7vnBZyvwgRPE5Fj szbSBR2UqD0vjux/6GFzxN88BIdvAYNCaU8KdntFEX/tbQPQMN5lhGOD0qut0DuT MO18YaaEkVj/jOAA1SP3CwLn8WHs9ByQYWRv+WqNbpFYK/guLvBvyYTvbNCylx1G 1PG+bsn/ypjiHDBZ1pKXjbqMTRZtRfbK7KGKeHpSKEJ/dkALxHaHlYQbjzGfK+I0 tLCfzYTtIC72WrRyIGOD/88KMUAxxgs+l5tsJri9F+s2/8bwH4anx0ZK3PQX5S1L XL5yO1NCa/crA3YliPMsxD0n2nahUlDH//4VHuUlJWzQYsCSECHtsLeO1X6DcePZ mQ4dlws/cdNJs+7yyAQ+svU93qkkDVmLDNFYROuEN7qTA32MEsaFsSRirAjWivSq q01N+qc02H2CzVrMy66KuMV/Lgrcwt6EOAmKrEq6Ilxa4e8T1qouE4vjVrVm/uQt ji1okKeFGtlDqtoJPHk045GAzNnUbLs1rC32GcBUmDw/39xkOPg= =aJK1 -----END PGP SIGNATURE----- --=-=-=--