Linux-i2c Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver"
@ 2021-02-09 11:05 Wolfram Sang
  2021-02-26 16:43 ` Jean Delvare
  2021-03-07  5:42 ` Wolfram Sang
  0 siblings, 2 replies; 7+ messages in thread
From: Wolfram Sang @ 2021-02-09 11:05 UTC (permalink / raw)
  To: linux-i2c, Jean Delvare; +Cc: linux-renesas-soc, Wolfram Sang

This reverts commit 34806fc4e7090b34e32fa1110d546ab5ce01a6a0. It was
developed against an experimental kernel. The regular kernel does not
update the new message length to userspace, so the check is always false
positive. We can't change the kernel behaviour because it would break
the ABI. So revert this commit.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Very embarrasing :( I am sorry for this. Jean, maybe this is worth a
4.2.1. release?

 tools/i2ctransfer.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tools/i2ctransfer.c b/tools/i2ctransfer.c
index f2a4df8..b0e8d43 100644
--- a/tools/i2ctransfer.c
+++ b/tools/i2ctransfer.c
@@ -88,12 +88,7 @@ static void print_msgs(struct i2c_msg *msgs, __u32 nmsgs, unsigned flags)
 		int recv_len = msgs[i].flags & I2C_M_RECV_LEN;
 		int print_buf = (read && (flags & PRINT_READ_BUF)) ||
 				(!read && (flags & PRINT_WRITE_BUF));
-		__u16 len = msgs[i].len;
-
-		if (recv_len && print_buf && len != msgs[i].buf[0] + 1) {
-			fprintf(stderr, "Correcting wrong msg length after recv_len! Please fix the I2C driver and/or report.\n");
-			len = msgs[i].buf[0] + 1;
-		}
+		__u16 len = recv_len ? msgs[i].buf[0] + 1 : msgs[i].len;
 
 		if (flags & PRINT_HEADER) {
 			fprintf(output, "msg %u: addr 0x%02x, %s, len ",
-- 
2.28.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver"
  2021-02-09 11:05 [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver" Wolfram Sang
@ 2021-02-26 16:43 ` Jean Delvare
  2021-03-10 20:46   ` Wolfram Sang
  2021-03-07  5:42 ` Wolfram Sang
  1 sibling, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2021-02-26 16:43 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-renesas-soc

Hi Wolfram,

On Tue,  9 Feb 2021 12:05:56 +0100, Wolfram Sang wrote:
> This reverts commit 34806fc4e7090b34e32fa1110d546ab5ce01a6a0. It was
> developed against an experimental kernel. The regular kernel does not
> update the new message length to userspace, so the check is always false
> positive. We can't change the kernel behaviour because it would break
> the ABI. So revert this commit.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> Very embarrasing :( I am sorry for this. Jean, maybe this is worth a
> 4.2.1. release?

Sorry for not catching this, I must say I did not remember exactly what
the API was supposed to be, and I did not have any device to test the
change.

We don't usually do minor version updates for bug fixes. Instead, what
I do is maintain a list of such "must have" fixes, that package
maintainers can refer to. Look for "Recommended patches" at:

https://i2c.wiki.kernel.org/index.php/I2C_Tools

There's no section for version 4.2 yet, but we can add one as soon as
the commit hits the public repository.

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver"
  2021-02-09 11:05 [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver" Wolfram Sang
  2021-02-26 16:43 ` Jean Delvare
@ 2021-03-07  5:42 ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2021-03-07  5:42 UTC (permalink / raw)
  To: linux-i2c, Jean Delvare; +Cc: linux-renesas-soc


[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

On Tue, Feb 09, 2021 at 12:05:56PM +0100, Wolfram Sang wrote:
> This reverts commit 34806fc4e7090b34e32fa1110d546ab5ce01a6a0. It was
> developed against an experimental kernel. The regular kernel does not
> update the new message length to userspace, so the check is always false
> positive. We can't change the kernel behaviour because it would break
> the ABI. So revert this commit.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied to master.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver"
  2021-02-26 16:43 ` Jean Delvare
@ 2021-03-10 20:46   ` Wolfram Sang
  2021-04-10  8:14     ` Peter Korsgaard
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2021-03-10 20:46 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-i2c, linux-renesas-soc


[-- Attachment #1: Type: text/plain, Size: 484 bytes --]


> We don't usually do minor version updates for bug fixes. Instead, what
> I do is maintain a list of such "must have" fixes, that package
> maintainers can refer to. Look for "Recommended patches" at:
> 
> https://i2c.wiki.kernel.org/index.php/I2C_Tools
> 
> There's no section for version 4.2 yet, but we can add one as soon as
> the commit hits the public repository.

I added a section now for the 4.2 release. And (finally!) started
cleaning up the wiki a little.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver"
  2021-03-10 20:46   ` Wolfram Sang
@ 2021-04-10  8:14     ` Peter Korsgaard
  2021-04-13 12:54       ` Wolfram Sang
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2021-04-10  8:14 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Jean Delvare, linux-i2c, linux-renesas-soc

>>>>> "Wolfram" == Wolfram Sang <wsa+renesas@sang-engineering.com> writes:

 >> We don't usually do minor version updates for bug fixes. Instead, what
 >> I do is maintain a list of such "must have" fixes, that package
 >> maintainers can refer to. Look for "Recommended patches" at:
 >> 
 >> https://i2c.wiki.kernel.org/index.php/I2C_Tools
 >> 
 >> There's no section for version 4.2 yet, but we can add one as soon as
 >> the commit hits the public repository.

 > I added a section now for the 4.2 release. And (finally!) started
 > cleaning up the wiki a little.

Thanks! As a packager, I must say that this way of handling bugfixes
isn't great - I only just noticed this now by accident.

What is the issue with making bugfix releases?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver"
  2021-04-10  8:14     ` Peter Korsgaard
@ 2021-04-13 12:54       ` Wolfram Sang
  2021-04-21 20:01         ` Peter Korsgaard
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2021-04-13 12:54 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: Jean Delvare, linux-i2c, linux-renesas-soc


[-- Attachment #1: Type: text/plain, Size: 367 bytes --]


>  > I added a section now for the 4.2 release. And (finally!) started
>  > cleaning up the wiki a little.
> 
> Thanks! As a packager, I must say that this way of handling bugfixes
> isn't great - I only just noticed this now by accident.
> 
> What is the issue with making bugfix releases?

Instead of a minor 4.2.1 we could maybe also simply do a 4.3?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver"
  2021-04-13 12:54       ` Wolfram Sang
@ 2021-04-21 20:01         ` Peter Korsgaard
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2021-04-21 20:01 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Jean Delvare, linux-i2c, linux-renesas-soc

>>>>> "Wolfram" == Wolfram Sang <wsa+renesas@sang-engineering.com> writes:

 >> > I added a section now for the 4.2 release. And (finally!) started
 >> > cleaning up the wiki a little.
 >> 
 >> Thanks! As a packager, I must say that this way of handling bugfixes
 >> isn't great - I only just noticed this now by accident.
 >> 
 >> What is the issue with making bugfix releases?

 > Instead of a minor 4.2.1 we could maybe also simply do a 4.3?

Sure, that is also fine by me.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 11:05 [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver" Wolfram Sang
2021-02-26 16:43 ` Jean Delvare
2021-03-10 20:46   ` Wolfram Sang
2021-04-10  8:14     ` Peter Korsgaard
2021-04-13 12:54       ` Wolfram Sang
2021-04-21 20:01         ` Peter Korsgaard
2021-03-07  5:42 ` Wolfram Sang

Linux-i2c Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-i2c/0 linux-i2c/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-i2c linux-i2c/ https://lore.kernel.org/linux-i2c \
		linux-i2c@vger.kernel.org
	public-inbox-index linux-i2c

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-i2c


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git