Skip to contentSkip to conversation

drm/bridge/synopsys: dsi: Add fix & warning in dsi_host_transfer()

PATCH Superseded Philippe Cornu 3 participants 11 messages Jan 23, 2018 – Jan 25, 2018

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover drm/bridge/synopsys: dsi: Add fix & warning in dsi_host_transfer()

Add a fix & a warning in the dsi_host_transfer().

Philippe Cornu (2):
drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value drm/bridge/synopsys: dsi: Add a warning msg on dsi read operations

 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/2 drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value

The dw_mipi_dsi_host_transfer() must return the number of bytes transmitted/received on success instead of 0.
Note: nb_bytes is introduced in this patch as it will be re-used with the future dcs/generic dsi read feature.

---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +8 -2
index f458798af788..096cf5e5bb30 100644
@@ -403,7 +403,7 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
 {
 	struct dw_mipi_dsi *dsi = host_to_dsi(host);
 	struct mipi_dsi_packet packet;
-	int ret;
+	int ret, nb_bytes;
 
 	ret = mipi_dsi_create_packet(&packet, msg);
 	if (ret) {
@@ -413,7 +413,13 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
 
 	dw_mipi_message_config(dsi, msg);
 
-	return dw_mipi_dsi_write(dsi, &packet);
+	ret = dw_mipi_dsi_write(dsi, &packet);
+	if (ret)
+		return ret;
+
+	nb_bytes = packet.size;
+
+	return nb_bytes;
 }
 
 static const struct mipi_dsi_host_ops dw_mipi_dsi_host_ops = {
Signature · 1 line
2.15.1
#2 lore raw

Re: [PATCH v1 1/2] drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value

Hi Philippe,

Quoted 2 lines · Philippe Cornu

The dw_mipi_dsi_host_transfer() must return the number of bytes transmitted/received on success instead of 0.

I'm a little confused. As of the latest drm-misc-next I'm looking at, this still has conflicting documentation.

For ->transfer():

On success it shall return the number of bytes
* transmitted for write packets or the number of bytes received for read
* packets.

While mipi_dsi_generic_read() says:

* Return: The number of bytes successfully read or a negative error code on
* failure.

But it just returns the value that ->transfer() returns.

So I'm not sure whether the documentation is still wrong, or if the implementation is.

Anyway, I guess maybe that isn't super-critical to *this* patch, since we don't have RX support yet...

Quoted 2 lines

Note: nb_bytes is introduced in this patch as it will be re-used with the future dcs/generic dsi read feature.

It feels like you could just wait to add that when you need it? It really feels trivial and useless right now :)

Brian

Quoted 37 lines
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +8 -3
index f458798af788..096cf5e5bb30 100644
@@ -403,7 +403,7 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
 {
        struct dw_mipi_dsi *dsi = host_to_dsi(host);
        struct mipi_dsi_packet packet;
-       int ret;
+       int ret, nb_bytes;
 
        ret = mipi_dsi_create_packet(&packet, msg);
        if (ret) {
@@ -413,7 +413,13 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
 
        dw_mipi_message_config(dsi, msg);
 
-       return dw_mipi_dsi_write(dsi, &packet);
+       ret = dw_mipi_dsi_write(dsi, &packet);
+       if (ret)
+               return ret;
+
+       nb_bytes = packet.size;
+
+       return nb_bytes;
 }
 
 static const struct mipi_dsi_host_ops dw_mipi_dsi_host_ops = {
--

2.15.1

#3 lore raw

Re: [PATCH v1 1/2] drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value

Hi Brian,

And many thanks for your review.

Quoted 15 lines · Brian Norris

Hi Philippe,

Quoted 2 lines · Philippe Cornu

The dw_mipi_dsi_host_transfer() must return the number of bytes transmitted/received on success instead of 0.

I'm a little confused. As of the latest drm-misc-next I'm looking at, this still has conflicting documentation.

For ->transfer():

On success it shall return the number of bytes
* transmitted for write packets or the number of bytes received for read
* packets.

Quoted 7 lines

While mipi_dsi_generic_read() says:

* Return: The number of bytes successfully read or a negative error code on
* failure.

But it just returns the value that ->transfer() returns.

Not sure to follow you here: mipi_dsi_generic_read() will trig a dsi generic read so it has to return "the number of bytes received for read packets" as explained for the ->transfer() function... so it looks "coherent"...

But maybe you want to point out something different?

Quoted 6 lines

So I'm not sure whether the documentation is still wrong, or if the implementation is.

Anyway, I guess maybe that isn't super-critical to *this* patch, since we don't have RX support yet...

The main reason why I want to "fix" this is because I do not want to explain to our customers (writing dsi panel drivers) why we have a different returned value compare to other platforms : )

Quoted 8 lines
Quoted 2 lines

Note: nb_bytes is introduced in this patch as it will be re-used with the future dcs/generic dsi read feature.

It feels like you could just wait to add that when you need it? It really feels trivial and useless right now :)

Brian

Thanks, I agree, I will write & send a simpler version. Philippe :-)

Quoted 42 lines
Quoted 35 lines
---
  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +8 -3
index f458798af788..096cf5e5bb30 100644
@@ -403,7 +403,7 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
  {
         struct dw_mipi_dsi *dsi = host_to_dsi(host);
         struct mipi_dsi_packet packet;
-       int ret;
+       int ret, nb_bytes;
 
         ret = mipi_dsi_create_packet(&packet, msg);
         if (ret) {
@@ -413,7 +413,13 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
 
         dw_mipi_message_config(dsi, msg);
 
-       return dw_mipi_dsi_write(dsi, &packet);
+       ret = dw_mipi_dsi_write(dsi, &packet);
+       if (ret)
+               return ret;
+
+       nb_bytes = packet.size;
+
+       return nb_bytes;
  }
 
  static const struct mipi_dsi_host_ops dw_mipi_dsi_host_ops = {
--
Quoted 2 lines

2.15.1

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

#4 lore raw

Re: [PATCH v1 1/2] drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value

Hi Philippe,

Quoted 24 lines · Philippe CORNU
Quoted 15 lines · Brian Norris

Hi Philippe,

Quoted 2 lines · Philippe Cornu

The dw_mipi_dsi_host_transfer() must return the number of bytes transmitted/received on success instead of 0.

I'm a little confused. As of the latest drm-misc-next I'm looking at, this still has conflicting documentation.

For ->transfer():

On success it shall return the number of bytes
* transmitted for write packets or the number of bytes received for read
* packets.

Quoted 7 lines

While mipi_dsi_generic_read() says:

* Return: The number of bytes successfully read or a negative error code on
* failure.

But it just returns the value that ->transfer() returns.

Quoted 6 lines

Not sure to follow you here: mipi_dsi_generic_read() will trig a dsi generic read so it has to return "the number of bytes received for read packets" as explained for the ->transfer() function... so it looks "coherent"...

But maybe you want to point out something different?

Actually, reading back what I wrote, I'm not sure it made sense. I think *I* was confusing "supporting TX only" with "supporting TX and RX". I believe the documentation isn't conflicting, but your current patch is a little misleading.

With your current patch, you're returning the 'mipi_dsi_packet::size', which is the sum of both TX and RX. Since we only support TX right now, I suppose that actually is fine (because 'rx_len == 0'). But if we start supporting RX too, then this field is not the right one to return.

Anyway, maybe this patch was fine as it was. But when you get RX support, this will have to be something like:

	if (msg->rx_len)
		return msg->rx_len;
	else
		return packet.size;

BTW, does anyone actually care about seeing the number of TX bytes returned? That seems weird, because I wouldn't expect you'd get a good result from a partial TX (dunno about partial RX). And I also see that there are other drivers that get this all wrong too. See mtk_dsi_host_transfer(), which only returns 0 for TX and 'recv_cnt' for RX.

So all-in-all, maybe my problem isn't that the documentation is conflicting, exactly, but that the requirements are somewhat odd, such that either implementations get it wrong (2 of 3 that I've looked at!), or they have to write somewhat odd special-casing.

Quoted 10 lines
Quoted 6 lines

So I'm not sure whether the documentation is still wrong, or if the implementation is.

Anyway, I guess maybe that isn't super-critical to *this* patch, since we don't have RX support yet...

The main reason why I want to "fix" this is because I do not want to explain to our customers (writing dsi panel drivers) why we have a different returned value compare to other platforms : )

Brian

#5 lore raw

Re: [PATCH v1 1/2] drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value

Quoted 30 lines · Brian Norris

Hi Philippe,

Quoted 27 lines · Philippe CORNU
Quoted 14 lines · Brian Norris

Hi Philippe,

Quoted 2 lines · Philippe Cornu

The dw_mipi_dsi_host_transfer() must return the number of bytes transmitted/received on success instead of 0.

I'm a little confused. As of the latest drm-misc-next I'm looking at, this still has conflicting documentation.

For ->transfer():

On success it shall return the number of bytes
* transmitted for write packets or the number of bytes received for read
* packets.

Quoted 7 lines

While mipi_dsi_generic_read() says:

* Return: The number of bytes successfully read or a negative error code on
* failure.

But it just returns the value that ->transfer() returns.

Not sure to follow you here: mipi_dsi_generic_read() will trig a dsi generic read so it has to return "the number of bytes received for read packets" as explained for the ->transfer() function... so it looks "coherent"...

Quoted 8 lines
Quoted 1 line

But maybe you want to point out something different?

Actually, reading back what I wrote, I'm not sure it made sense. I think *I* was confusing "supporting TX only" with "supporting TX and RX". I believe the documentation isn't conflicting, but your current patch is a little misleading.

With your current patch, you're returning the 'mipi_dsi_packet::size', which is the sum of both TX and RX.

I did not found docs saying mipi_dsi_packet::size is a sum of tx and rx. tx and rx packets are two different packets, so they do not sum up. But thanks for bringing it up, it shows docs are incomplete/misleading.

Quoted 12 lines

Since we only support TX right now,
I suppose that actually is fine (because 'rx_len == 0'). But if we start supporting RX too, then this field is not the right one to return.

Anyway, maybe this patch was fine as it was. But when you get RX support, this will have to be something like:

	if (msg->rx_len)
		return msg->rx_len;
	else
		return packet.size;
Quoted 6 lines

BTW, does anyone actually care about seeing the number of TX bytes returned? That seems weird, because I wouldn't expect you'd get a good result from a partial TX (dunno about partial RX). And I also see that there are other drivers that get this all wrong too. See mtk_dsi_host_transfer(), which only returns 0 for TX and 'recv_cnt' for RX.

As far as I remember MIPI DSI standard does not allow partial TX, it is all-or-nothing operation.

Quoted 5 lines

So all-in-all, maybe my problem isn't that the documentation is conflicting, exactly, but that the requirements are somewhat odd, such that either implementations get it wrong (2 of 3 that I've looked at!), or they have to write somewhat odd special-casing.

mipi_dsi_host_ops::transfer in case of write sends only tx packet, in case of read it sends tx packets and receives rx packet, so it can be confusing what it should return in case of read. IMO changing mipi_dsi_host_ops::transfer to always return number of bytes RECEIVED or error should make it clearer and simpler.

+CC Thierry

Regards
Andrzej

Quoted 15 lines
Quoted 10 lines
Quoted 7 lines

So I'm not sure whether the documentation is still wrong, or if the implementation is.

Anyway, I guess maybe that isn't super-critical to *this* patch, since we don't have RX support yet...

The main reason why I want to "fix" this is because I do not want to explain to our customers (writing dsi panel drivers) why we have a different returned value compare to other platforms : )

Brian
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Re: [PATCH v1 1/2] drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value

Quoted 7 lines · Andrzej Hajda
Quoted 2 lines · Brian Norris

With your current patch, you're returning the 'mipi_dsi_packet::size', which is the sum of both TX and RX.

I did not found docs saying mipi_dsi_packet::size is a sum of tx and rx. tx and rx packets are two different packets, so they do not sum up. But thanks for bringing it up, it shows docs are incomplete/misleading.

Ugh, I misread that again. No, mipi_dsi_packet::size is NOT claimed to contain both TX and RX. It just says "size of the packet", and packet clearly does not hold the RX data anyway. I don't know what's happening to my reading comprehension...

But the mismatch on whether drivers implement these correctly and whether any callers actually care about the documented semantics still stands.

Brian

#7 lore raw

PATCH 2/2 drm/bridge/synopsys: dsi: Add a warning msg on dsi read operations

In reply to Philippe Cornu

The DCS/GENERIC DSI read feature is not yet implemented so it is important to warn the host_transfer() caller in case of read operation requests.

---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +8 -1
index 096cf5e5bb30..e46ddff8601c 100644
@@ -417,7 +417,14 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
 	if (ret)
 		return ret;
 
-	nb_bytes = packet.size;
+	if (msg->rx_buf && msg->rx_len > 0) {
+		/* TODO dw drv improvements: implement read feature */
+		dev_warn(dsi->dev, "read operations not yet implemented\n");
+		return -EPERM;
+
+	} else {
+		nb_bytes = packet.size;
+	}
 
 	return nb_bytes;
 }
Signature · 1 line
2.15.1
#8 lore raw

Re: [PATCH v1 2/2] drm/bridge/synopsys: dsi: Add a warning msg on dsi read operations

Hi Philippe,

I see you sent this out already today, while I only just responded (late) to your questions about it... oh well :)

Quoted 14 lines · Philippe Cornu

The DCS/GENERIC DSI read feature is not yet implemented so it is important to warn the host_transfer() caller in case of read operation requests.

---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -0
index 096cf5e5bb30..e46ddff8601c 100644

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, · line 420

Quoted 5 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +1 -1
@@ -417,7 +417,14 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
        if (ret)
                return ret;
 
-       nb_bytes = packet.size;
+       if (msg->rx_buf && msg->rx_len > 0) {

It feels like you should do this check *before* you start writing anything. It's possible to have a combination TX/RX command, and it would be counterintuitive to only do half the operation then return with an argument error.

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, · line 423

Quoted 3 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +3 -0
+               /* TODO dw drv improvements: implement read feature */
+               dev_warn(dsi->dev, "read operations not yet implemented\n");
+               return -EPERM;

I'm not sure -EPERM is right. Feels like -EINVAL, -ENOSYS, or -EOPNOTSUPP. I think -ENOSYS actually has been abused somewhat, so maybe one of the other two.

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, · line 424

Quoted 1 line
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +1 -0
+

Spurious blank line?

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, · line 427

Quoted 3 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +3 -0
+       } else {
+               nb_bytes = packet.size;
+       }

You don't actually need to put this sort of thing in the 'else' case. The other branch is an error-handling case, which definitely 'return's early, and it's pretty standard coding style to avoid indenting the "good" path like this.

Brian

Quoted 6 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -1
        return nb_bytes;
 }
--

2.15.1

#9 lore raw

Re: [PATCH v1 2/2] drm/bridge/synopsys: dsi: Add a warning msg on dsi read operations

Hi Brian,

Quoted 5 lines · Brian Norris

Hi Philippe,

I see you sent this out already today, while I only just responded (late) to your questions about it... oh well :)

I got a short period to clean-up and adds features to this driver (1.31 ip version + maybe the read feature), sorry to have not wait a single day more.

Quoted 18 lines · Philippe Cornu
Quoted 17 lines

The DCS/GENERIC DSI read feature is not yet implemented so it is important to warn the host_transfer() caller in case of read operation requests.

---
  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -0
index 096cf5e5bb30..e46ddff8601c 100644
@@ -417,7 +417,14 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
         if (ret)
                 return ret;
 
Quoted 8 lines

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, · line 420

Quoted 2 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +1 -1
-       nb_bytes = packet.size;
+       if (msg->rx_buf && msg->rx_len > 0) {

It feels like you should do this check *before* you start writing anything. It's possible to have a combination TX/RX command, and it would be counterintuitive to only do half the operation then return with an argument error.

Many thanks for your review.

I agree with your comments.

Well, my patch is not good at all because it contains a small part of the read feature I am writing... but it is not the purpose of this patch.

No excuse, sorry guys for making you waste time.

I will re-write a new patch 100% decorrelated from a possible future read feature.

I could also wait until I have a working read feature but as it could take some times, I prefer warning users asap.

Quoted 8 lines

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, · line 423

Quoted 3 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +3 -0
+               /* TODO dw drv improvements: implement read feature */
+               dev_warn(dsi->dev, "read operations not yet implemented\n");
+               return -EPERM;

I'm not sure -EPERM is right. Feels like -EINVAL, -ENOSYS, or -EOPNOTSUPP. I think -ENOSYS actually has been abused somewhat, so maybe one of the other two.

not easy to pick the right one. I will use -EINVAL.

Quoted 4 lines

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, · line 424

Quoted 1 line
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +1 -0
+

Spurious blank line?

thanks

Quoted 11 lines

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, · line 427

Quoted 3 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +3 -0
+       } else {
+               nb_bytes = packet.size;
+       }

You don't actually need to put this sort of thing in the 'else' case. The other branch is an error-handling case, which definitely 'return's early, and it's pretty standard coding style to avoid indenting the "good" path like this.

Brian

The else part is linked to my "read feature" too, sorry for that. I will do it simpler in next version.

Thank you,
Philippe :-)

Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -1
         return nb_bytes;
  }
--

2.15.1

#10 lore raw

Re: [PATCH v1 2/2] drm/bridge/synopsys: dsi: Add a warning msg on dsi read operations

Hi Philippe,

Quoted 8 lines · Philippe CORNU
Quoted 3 lines · Brian Norris

I see you sent this out already today, while I only just responded (late) to your questions about it... oh well :)

I got a short period to clean-up and adds features to this driver (1.31 ip version + maybe the read feature), sorry to have not wait a single day more.

No problem. The key word was "late"; my mail was buried enough I just missed responding. Not your fault!

Quoted 27 lines
Quoted 18 lines · Philippe Cornu
Quoted 17 lines

The DCS/GENERIC DSI read feature is not yet implemented so it is important to warn the host_transfer() caller in case of read operation requests.

---
  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +0 -0
index 096cf5e5bb30..e46ddff8601c 100644
@@ -417,7 +417,14 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host,
         if (ret)
                 return ret;
 
Quoted 8 lines

drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, · line 420

Quoted 2 lines
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +1 -1
-       nb_bytes = packet.size;
+       if (msg->rx_buf && msg->rx_len > 0) {

It feels like you should do this check *before* you start writing anything. It's possible to have a combination TX/RX command, and it would be counterintuitive to only do half the operation then return with an argument error.

Quoted 8 lines

Many thanks for your review.

I agree with your comments.

Well, my patch is not good at all because it contains a small part of the read feature I am writing... but it is not the purpose of this patch.

No excuse, sorry guys for making you waste time.

No worries. These weren't that bad anyway, just a little suboptimal :)

Quoted 2 lines

I will re-write a new patch 100% decorrelated from a possible future read feature.

Yeah, that would probably work best. It's hard to write and review good "intermediate" code; we should write it as if the code will last as-is.

Quoted 2 lines

I could also wait until I have a working read feature but as it could take some times, I prefer warning users asap.

Sounds good.

[snip]

Thanks,
Brian