bcusdk: fix endless recursion when opening USB backends
PATCH 1/1 bcusdk: fix endless recursion when opening USB backends
The eibd usb backend implements clock_gettime, and calls pth_int_time from there. pth_int_time will result in a call to clock_gettime, resulting in an endless recursion.
The problem is that the USB backend shouldn't overrule clock_gettime in the first place. Since the function does semantically and syntactically the same, the function is place in comment alltogether.
--- package/bcusdk/0002-linux-usbfs-clock-gettime.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 package/bcusdk/0002-linux-usbfs-clock-gettime.patch
package/bcusdk/0002-linux-usbfs-clock-gettime.patch new file +16 -0
@@ -0,0 +1,16 @@ +--- a/eibd/usb/linux_usbfs.c 2017-07-29 22:24:15.890087674 +0200 ++++ b/eibd/usb/linux_usbfs.c 2017-07-29 22:20:11.830085100 +0200 +@@ -52,11 +52,13 @@ + return 0; + } + ++/* don't redefine clock_gettime, use the system version + int clock_gettime(clockid_t clk_id, struct timespec *tp) + { + pth_int_time (tp); + return 0; + } ++*/ + + /* sysfs vs usbfs: + * opening a usbfs node causes the device to be resumed, so we attempt to
Signature · 1 line
1.8.5.rc3
PATCH 1/1 bcusdk: fix endless recursion when opening USB backends
Hello,
package/bcusdk/0002-linux-usbfs-clock-gettime.patch
Quoted 5 lines · Kurt Van Dijck
package/bcusdk/0002-linux-usbfs-clock-gettime.patch new file +0
-0
All patches need to have a description + Signed-off-by. Also, since the upstream project is using a Git repository, please use Git formatted patches (i.e patches generated by git format-patch -N).
In addition, rather than commenting the code, just remove it entirely, it makes the change more obvious.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/1 bcusdk: fix endless recursion when opening USB backends
--- Original message ---
Quoted 11 lines
Date: Fri, 25 Aug 2017 16:00:04 +0200
From: Thomas Petazzoni <[email protected]>
To: Kurt Van Dijck <[email protected]>
Cc: buildroot at busybox.net
Subject: Re: [Buildroot] [PATCH] bcusdk: fix endless recursion when opening
USB backendsHello,
On Fri, 25 Aug 2017 09:26:39 +0200, Kurt Van Dijck wrote:
Quoted 7 lines
package/bcusdk/0002-linux-usbfs-clock-gettime.patch
Quoted 5 lines
package/bcusdk/0002-linux-usbfs-clock-gettime.patch new file +0
-0All patches need to have a description + Signed-off-by. Also, since the
ok. I'll redo this patch.
Quoted 2 lines
upstream project is using a Git repository, please use Git formatted patches (i.e patches generated by git format-patch -N).
I'm not sure what you mean with 'upstream project' here? Busybox or bcusdk? bcusdk isn't in git AFAIK.
Quoted 3 lines
In addition, rather than commenting the code, just remove it entirely, it makes the change more obvious.
ok,
Kind regards,
Kurt
PATCH 1/1 bcusdk: fix endless recursion when opening USB backends
Hello,
Quoted 4 lines · Kurt Van Dijck
Quoted 2 lines
upstream project is using a Git repository, please use Git formatted patches (i.e patches generated by git format-patch -N).
I'm not sure what you mean with 'upstream project' here? Busybox or bcusdk?
bcusdk of course.
Quoted 1 line
bcusdk isn't in git AFAIK.
https://sourceforge.net/p/bcusdk/code/ci/master/tree/ is a Git repository.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/1 bcusdk: fix endless recursion when opening USB backends
--- Original message ---
Quoted 15 lines
Date: Fri, 25 Aug 2017 22:16:17 +0200
From: Thomas Petazzoni <[email protected]>
To: Kurt Van Dijck <[email protected]>
Cc: buildroot at busybox.net
Subject: Re: [Buildroot] [PATCH] bcusdk: fix endless recursion when opening
USB backends
X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu)Hello,
Quoted 3 lines · Kurt Van Dijck
Quoted 2 lines
upstream project is using a Git repository, please use Git formatted patches (i.e patches generated by git format-patch -N).
Quoted 8 lines
Quoted 1 line
I'm not sure what you mean with 'upstream project' here? Busybox or bcusdk?
bcusdk of course.
Quoted 1 line
bcusdk isn't in git AFAIK.
https://sourceforge.net/p/bcusdk/code/ci/master/tree/ is a Git repository.
One day, I'll switch to https://github.com/knxd/knxd anyway.
Kurt
PATCH 1/1 bcusdk: fix endless recursion when opening USB backends
Hello,
Quoted 4 lines · Kurt Van Dijck
Quoted 2 lines
https://sourceforge.net/p/bcusdk/code/ci/master/tree/ is a Git repository.
One day, I'll switch to https://github.com/knxd/knxd anyway.
Interesting. I see it's a fork of bcusdk. So perhaps we could drop the bcusdk package at some point, and replace it with a knxd package. Indeed, knxd seems to be actively maintained, which isn't the case of bcusdk.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/1 bcusdk: fix endless recursion when opening USB backends
Quoted 7 lines
Hello,
Quoted 3 lines · Kurt Van Dijck
Quoted 2 lines
https://sourceforge.net/p/bcusdk/code/ci/master/tree/ is a Git repository.
Quoted 6 lines
Quoted 1 line
One day, I'll switch to https://github.com/knxd/knxd anyway.
Interesting. I see it's a fork of bcusdk. So perhaps we could drop the bcusdk package at some point, and replace it with a knxd package. Indeed, knxd seems to be actively maintained, which isn't the case of bcusdk.
Yes. but bcusdk does it's job at the moment at my place, and knxd does not.
Kurt