* [Buildroot] [PATCH] package/i2c-tools: add upstream post-4.2 i2ctransfer fix
@ 2021-04-10 8:12 Peter Korsgaard
2021-04-11 5:41 ` Baruch Siach
0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2021-04-10 8:12 UTC (permalink / raw)
To: buildroot
i2c-tools 4.2 contained an invalid check, leading to verbose false-positive
warning messages when the variable length ({r,w}?) option is used:
https://www.spinics.net/lists/linux-i2c/msg50032.html
Unfortunately upstream does not make bugfix releases, instead opting to list
such bugfixes on the wiki:
https://i2c.wiki.kernel.org/index.php/I2C_Tools
So add the patch here.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
...transfer-add-check-for-returned-leng.patch | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 package/i2c-tools/0001-Revert-tools-i2ctransfer-add-check-for-returned-leng.patch
diff --git a/package/i2c-tools/0001-Revert-tools-i2ctransfer-add-check-for-returned-leng.patch b/package/i2c-tools/0001-Revert-tools-i2ctransfer-add-check-for-returned-leng.patch
new file mode 100644
index 0000000000..7173efe219
--- /dev/null
+++ b/package/i2c-tools/0001-Revert-tools-i2ctransfer-add-check-for-returned-leng.patch
@@ -0,0 +1,41 @@
+From 06a1909ae1e8ae1edc70dc48dd22a32ba5eceecb Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Date: Tue, 9 Feb 2021 12:05:56 +0100
+Subject: [PATCH] Revert "tools: i2ctransfer: add check for returned length
+ from driver"
+
+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>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+[Peter: drop CHANGES update]
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ tools/i2ctransfer.c | 7 +------
+ 1 file changed, 1 insertions(+), 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.20.1
+
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] package/i2c-tools: add upstream post-4.2 i2ctransfer fix
2021-04-10 8:12 [Buildroot] [PATCH] package/i2c-tools: add upstream post-4.2 i2ctransfer fix Peter Korsgaard
@ 2021-04-11 5:41 ` Baruch Siach
2021-04-11 9:37 ` Peter Korsgaard
0 siblings, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2021-04-11 5:41 UTC (permalink / raw)
To: buildroot
Hi Peter,
On Sat, Apr 10 2021, Peter Korsgaard wrote:
> i2c-tools 4.2 contained an invalid check, leading to verbose false-positive
> warning messages when the variable length ({r,w}?) option is used:
>
> https://www.spinics.net/lists/linux-i2c/msg50032.html
Maybe also add a link to Jean's response:
https://www.spinics.net/lists/linux-i2c/msg50253.html
> Unfortunately upstream does not make bugfix releases, instead opting to list
> such bugfixes on the wiki:
>
> https://i2c.wiki.kernel.org/index.php/I2C_Tools
>
> So add the patch here.
>
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Thanks,
baruch
> ---
> ...transfer-add-check-for-returned-leng.patch | 41 +++++++++++++++++++
> 1 file changed, 41 insertions(+)
> create mode 100644 package/i2c-tools/0001-Revert-tools-i2ctransfer-add-check-for-returned-leng.patch
>
> diff --git a/package/i2c-tools/0001-Revert-tools-i2ctransfer-add-check-for-returned-leng.patch b/package/i2c-tools/0001-Revert-tools-i2ctransfer-add-check-for-returned-leng.patch
> new file mode 100644
> index 0000000000..7173efe219
> --- /dev/null
> +++ b/package/i2c-tools/0001-Revert-tools-i2ctransfer-add-check-for-returned-leng.patch
> @@ -0,0 +1,41 @@
> +From 06a1909ae1e8ae1edc70dc48dd22a32ba5eceecb Mon Sep 17 00:00:00 2001
> +From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> +Date: Tue, 9 Feb 2021 12:05:56 +0100
> +Subject: [PATCH] Revert "tools: i2ctransfer: add check for returned length
> + from driver"
> +
> +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>
> +Signed-off-by: Wolfram Sang <wsa@kernel.org>
> +[Peter: drop CHANGES update]
> +Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> +---
> + tools/i2ctransfer.c | 7 +------
> + 1 file changed, 1 insertions(+), 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.20.1
> +
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] package/i2c-tools: add upstream post-4.2 i2ctransfer fix
2021-04-11 5:41 ` Baruch Siach
@ 2021-04-11 9:37 ` Peter Korsgaard
2021-04-25 6:52 ` Peter Korsgaard
0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2021-04-11 9:37 UTC (permalink / raw)
To: buildroot
>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:
> Hi Peter,
> On Sat, Apr 10 2021, Peter Korsgaard wrote:
>> i2c-tools 4.2 contained an invalid check, leading to verbose false-positive
>> warning messages when the variable length ({r,w}?) option is used:
>>
>> https://www.spinics.net/lists/linux-i2c/msg50032.html
> Maybe also add a link to Jean's response:
> https://www.spinics.net/lists/linux-i2c/msg50253.html
Committed with the link added, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] package/i2c-tools: add upstream post-4.2 i2ctransfer fix
2021-04-11 9:37 ` Peter Korsgaard
@ 2021-04-25 6:52 ` Peter Korsgaard
0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2021-04-25 6:52 UTC (permalink / raw)
To: buildroot
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:
>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:
>> Hi Peter,
>> On Sat, Apr 10 2021, Peter Korsgaard wrote:
>>> i2c-tools 4.2 contained an invalid check, leading to verbose false-positive
>>> warning messages when the variable length ({r,w}?) option is used:
>>>
>>> https://www.spinics.net/lists/linux-i2c/msg50032.html
>> Maybe also add a link to Jean's response:
>> https://www.spinics.net/lists/linux-i2c/msg50253.html
> Committed with the link added, thanks.
Committed to 2021.02.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-25 6:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-10 8:12 [Buildroot] [PATCH] package/i2c-tools: add upstream post-4.2 i2ctransfer fix Peter Korsgaard
2021-04-11 5:41 ` Baruch Siach
2021-04-11 9:37 ` Peter Korsgaard
2021-04-25 6:52 ` Peter Korsgaard
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.