Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752578AbaAPEbU (ORCPT ); Wed, 15 Jan 2014 23:31:20 -0500 Received: from SpacedOut.fries.net ([67.64.210.234]:45758 "EHLO SpacedOut.fries.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751890AbaAPEbQ (ORCPT ); Wed, 15 Jan 2014 23:31:16 -0500 From: David Fries To: linux-kernel@vger.kernel.org Cc: Evgeniy Polyakov , GregKH Subject: [PATCH 03/15] w1: Only wake up the search process if it is going to be searching Date: Wed, 15 Jan 2014 22:29:14 -0600 Message-Id: <1389846566-28862-4-git-send-email-David@Fries.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1389846566-28862-1-git-send-email-David@Fries.net> References: <1389846566-28862-1-git-send-email-David@Fries.net> X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.9 (SpacedOut.fries.net [127.0.0.1]); Wed, 15 Jan 2014 22:31:10 -0600 (CST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's valid to set the search count to 0 to stop searching, so don't wake up the search thread to not search. Signed-off-by: David Fries Acked-by: Evgeniy Polyakov --- drivers/w1/w1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 67b6d5f..92766a9 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -243,7 +243,9 @@ static ssize_t w1_master_attribute_store_search(struct device * dev, mutex_lock(&md->mutex); md->search_count = tmp; mutex_unlock(&md->mutex); - wake_up_process(md->thread); + /* Only wake if it is going to be searching. */ + if (tmp) + wake_up_process(md->thread); return count; } -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/