From 2d537bc98fc365e466b7aff0b10855051d9b0783 Mon Sep 17 00:00:00 2001 From: Marcin Jurkowski Date: Mon, 29 Jun 2015 00:58:06 +0200 Subject: [PATCH] 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 --- ...-netlink-w1-status-message-detection.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 utils/owfs/patches/100-fix-netlink-w1-status-message-detection.patch 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 new file mode 100644 index 0000000000..251065fa2f --- /dev/null +++ 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 ; + }