commit 2d537bc98fc365e466b7aff0b10855051d9b0783
parent d6fe15a85c4690f34a73af77c6cf6f316acf75b6
Author: Marcin Jurkowski <marcin1j@gmail.com>
Date: Mon, 29 Jun 2015 00:58:06 +0200
owfs: fix the last netlink message recognition
This fixes the endless loop waiting for w1 subsystem connector status
message.
According to the 8a0427d kernel commit, the last (status) netlink msg
should have ack=seq, whereas all the others messages should have ack=seq+1.
This patch has been submitted upstream: https://sourceforge.net/p/owfs/bugs/66/.
For independent problem report, see this thread:
https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=98772
Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
Diffstat:
1 file changed, 30 insertions(+), 0 deletions(-)
diff --git a/utils/owfs/patches/100-fix-netlink-w1-status-message-detection.patch b/utils/owfs/patches/100-fix-netlink-w1-status-message-detection.patch
@@ -0,0 +1,30 @@
+AaAA
+--- a/module/owlib/src/c/ow_w1_parse.c
++++ b/module/owlib/src/c/ow_w1_parse.c
+@@ -237,7 +237,7 @@ enum Netlink_Read_Status W1_Process_Resp
+ owfree(nlp.nlm) ;
+ return nrs_nodev ;
+ }
+- if ( nrs_callback == NULL ) { // status message
++ if ( nrs_callback == NULL ) { // bus reset
+ owfree(nlp.nlm) ;
+ return nrs_complete ;
+ }
+@@ -246,7 +246,7 @@ enum Netlink_Read_Status W1_Process_Resp
+ nrs_callback( &nlp, v, pn ) ;
+ LEVEL_DEBUG("Called nrs_callback");
+ owfree(nlp.nlm) ;
+- if ( nlp.cn->ack != 0 ) {
++ if ( nlp.cn->seq != nlp.cn->ack ) {
+ if ( nlp.w1m->type == W1_LIST_MASTERS ) {
+ continue ; // look for more data
+ }
+@@ -254,7 +254,7 @@ enum Netlink_Read_Status W1_Process_Resp
+ continue ; // look for more data
+ }
+ }
+- nrs_callback = NULL ; // now look for status message
++ return nrs_complete ; // status message
+ }
+ return nrs_timeout ;
+ }