lkml.org 
[lkml]   [2008]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/30] W1: abort search early on on exit
Early abort if the master driver or the hardware goes away in the
middle of a bus search operation. The alternative is to spam the
print buffer up to 64*64 times with read errors in the case of USB.

Signed-off-by: David Fries <david@fries.net>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
---
drivers/w1/w1.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 25640f6..aac03f1 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -772,6 +772,11 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
/* extract the direction taken & update the device number */
tmp64 = (triplet_ret >> 2);
rn |= (tmp64 << i);
+
+ if (test_bit(W1_MASTER_NEED_EXIT, &dev->flags)) {
+ printk(KERN_INFO "Abort w1_search (exiting)\n");
+ return;
+ }
}

if ( (triplet_ret & 0x03) != 0x03 ) {
--
1.4.4.4[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2008-07-29 04:15    [W:0.281 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site