All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: Eric Anholt <eric@anholt.net>,
	Archit Taneja <architt@codeaurora.org>,
	dri-devel@lists.freedesktop.org,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Boris Brezillon <boris.brezillon@free-electrons.com>
Subject: Re: [PATCH 6/8] drm: Allow DSI devices to be registered before the host registers.
Date: Fri, 30 Jun 2017 10:48:27 +0200	[thread overview]
Message-ID: <2bf3dec6-95a9-9572-8999-bbd89726bdfc@samsung.com> (raw)
In-Reply-To: <87injeom3p.fsf@eliezer.anholt.net>

On 29.06.2017 17:22, Eric Anholt wrote:
> Andrzej Hajda <a.hajda@samsung.com> writes:
>
>> 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 nodes.
>>>>
>>>> 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 control
>>> 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 assumes
>>> that info.of_node stores the DSI host DT node. I think it should be okay as
>>> long as we mention the usage in a comment somewhere. The other option is to
>>> have a new info.host_node field to keep a track of the host DT node.
>> Field abuse is not a biggest issue.
>>
>> 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.
> It only changes the semantic if you past in a NULL host, from "oops" to
> "do something useful".
>
>> 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?
>>
>> I did not spent much time on this idea, so I cannot guarantee it has not
>> fundamental issues :)
> If component_add() isn't called during probe, then DSI would just get
> skipped during bind as far as I know.

No, drm master will wait till all components are present.

>
> I *think* what you're thinking is moving DSI host register to probe, 

yes, this way you will allow to create dsi devices.

> and
> then panel lookup stays in bind. 

no, panel lookup will be performed in dsi_host attach callback, and
component_add will be called also there, if all required panels/bridges
are get.

>  That seems much more risky to me -- do
> we know for sure that no mipi_dsi_device will do any DSI transactions
> during its probe?  I would expect some of them to.

I think it is irrelevant, with the current design only transactions
between prepare/unprepare callbacks have chances to succeed.

Andrzej

WARNING: multiple messages have this Message-ID (diff)
From: Andrzej Hajda <a.hajda@samsung.com>
To: Eric Anholt <eric@anholt.net>,
	Archit Taneja <architt@codeaurora.org>,
	dri-devel@lists.freedesktop.org,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/8] drm: Allow DSI devices to be registered before the host registers.
Date: Fri, 30 Jun 2017 10:48:27 +0200	[thread overview]
Message-ID: <2bf3dec6-95a9-9572-8999-bbd89726bdfc@samsung.com> (raw)
In-Reply-To: <87injeom3p.fsf@eliezer.anholt.net>

On 29.06.2017 17:22, Eric Anholt wrote:
> Andrzej Hajda <a.hajda@samsung.com> writes:
>
>> 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 nodes.
>>>>
>>>> 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 control
>>> 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 assumes
>>> that info.of_node stores the DSI host DT node. I think it should be okay as
>>> long as we mention the usage in a comment somewhere. The other option is to
>>> have a new info.host_node field to keep a track of the host DT node.
>> Field abuse is not a biggest issue.
>>
>> 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.
> It only changes the semantic if you past in a NULL host, from "oops" to
> "do something useful".
>
>> 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?
>>
>> I did not spent much time on this idea, so I cannot guarantee it has not
>> fundamental issues :)
> If component_add() isn't called during probe, then DSI would just get
> skipped during bind as far as I know.

No, drm master will wait till all components are present.

>
> I *think* what you're thinking is moving DSI host register to probe, 

yes, this way you will allow to create dsi devices.

> and
> then panel lookup stays in bind. 

no, panel lookup will be performed in dsi_host attach callback, and
component_add will be called also there, if all required panels/bridges
are get.

>  That seems much more risky to me -- do
> we know for sure that no mipi_dsi_device will do any DSI transactions
> during its probe?  I would expect some of them to.

I think it is irrelevant, with the current design only transactions
between prepare/unprepare callbacks have chances to succeed.

Andrzej




_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-06-30  8:49 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27 19:58 [PATCH 0/8] RPi touchscreen panel driver v4 Eric Anholt
2017-06-27 19:58 ` Eric Anholt
2017-06-27 19:58 ` [PATCH 1/8] drm/vc4: Fix DSI T_INIT timing Eric Anholt
2017-06-27 19:58   ` Eric Anholt
2017-06-29  9:02   ` Andrzej Hajda
2017-06-29  9:02     ` Andrzej Hajda
2017-06-27 19:58 ` [PATCH 2/8] drm/vc4: Fix misleading name of the continuous flag Eric Anholt
2017-06-27 19:58   ` Eric Anholt
2017-06-29  9:03   ` Andrzej Hajda
2017-06-29  9:03     ` Andrzej Hajda
2017-06-27 19:58 ` [PATCH 3/8] drm/vc4: Use drm_mode_vrefresh() in DSI fixup, in case vrefresh is 0 Eric Anholt
2017-06-27 19:58   ` Eric Anholt
2017-06-29  9:24   ` Andrzej Hajda
2017-06-29  9:24     ` Andrzej Hajda
2017-06-27 19:58 ` [PATCH 4/8] drm/bridge: Add a devm_ allocator for panel bridge Eric Anholt
2017-06-27 19:58   ` Eric Anholt
2017-06-29  9:30   ` Andrzej Hajda
2017-06-29  9:30     ` Andrzej Hajda
2017-06-27 19:58 ` [PATCH 5/8] drm/vc4: Delay DSI host registration until the panel has probed Eric Anholt
2017-06-27 19:58   ` Eric Anholt
2017-06-29  9:42   ` Andrzej Hajda
2017-06-29  9:42     ` Andrzej Hajda
2017-06-27 19:58 ` [PATCH 6/8] drm: Allow DSI devices to be registered before the host registers Eric Anholt
2017-06-27 19:58   ` Eric Anholt
2017-06-29  5:03   ` Archit Taneja
2017-06-29  5:03     ` Archit Taneja
2017-06-29 10:39     ` Andrzej Hajda
2017-06-29 10:39       ` Andrzej Hajda
2017-06-29 15:22       ` Eric Anholt
2017-06-29 15:22         ` Eric Anholt
2017-06-30  8:48         ` Andrzej Hajda [this message]
2017-06-30  8:48           ` Andrzej Hajda
2017-07-03 10:56       ` Archit Taneja
2017-07-03 10:56         ` Archit Taneja
2017-07-14 23:01         ` Eric Anholt
2017-07-14 23:01           ` Eric Anholt
2017-07-17 13:39           ` Archit Taneja
2017-07-17 13:39             ` Archit Taneja
2017-07-14 22:58     ` Eric Anholt
2017-07-14 22:58       ` Eric Anholt
2017-07-17  4:26       ` Archit Taneja
2017-07-17  4:26         ` Archit Taneja
2017-07-18 20:13         ` Eric Anholt
2017-07-18 20:13           ` Eric Anholt
2017-07-19  3:29           ` Archit Taneja
2017-07-19  3:29             ` Archit Taneja
2017-08-04  9:29           ` Boris Brezillon
2017-08-04  9:29             ` Boris Brezillon
2017-06-27 19:58 ` [PATCH 7/8] dt-bindings: Document the Raspberry Pi Touchscreen nodes Eric Anholt
2017-06-27 19:58   ` Eric Anholt
2017-06-27 19:58 ` [PATCH 8/8] drm/panel: Add support for the Raspberry Pi 7" Touchscreen Eric Anholt
2017-06-27 19:58   ` Eric Anholt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2bf3dec6-95a9-9572-8999-bbd89726bdfc@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=architt@codeaurora.org \
    --cc=boris.brezillon@free-electrons.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.