From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758580AbbDVX2i (ORCPT ); Wed, 22 Apr 2015 19:28:38 -0400 Received: from forward18j.cmail.yandex.net ([5.255.227.237]:46919 "EHLO forward18j.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbbDVX2g (ORCPT ); Wed, 22 Apr 2015 19:28:36 -0400 X-Greylist: delayed 357 seconds by postgrey-1.27 at vger.kernel.org; Wed, 22 Apr 2015 19:28:36 EDT From: Evgeniy Polyakov Envelope-From: drustafa@yandex.ru To: Dmitry Khromov , "linux-kernel@vger.kernel.org" Cc: "gregkh@linuxfoundation.org" , "rdunlap@infradead.org" In-Reply-To: <1429739735-32718-1-git-send-email-dk@icelogic.net> References: <552D4B21.4020803@infradead.org> <1429739735-32718-1-git-send-email-dk@icelogic.net> Subject: Re: [PATCH v2] w1: introduce an ability to specify microseconds bus scanning intervals MIME-Version: 1.0 Message-Id: <553621429744955@web10j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 23 Apr 2015 02:22:35 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Looks good to me. Greg, please pull it into your tree. Acked-by: Evgeniy Polyakov 23.04.2015, 00:56, "Dmitry Khromov" : > Signed-off-by: Dmitry Khromov > --- > šdrivers/w1/w1.c | 17 ++++++++++++++++- > š1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c > index 181f41c..c9a7ff6 100644 > --- a/drivers/w1/w1.c > +++ b/drivers/w1/w1.c > @@ -46,11 +46,15 @@ MODULE_AUTHOR("Evgeniy Polyakov "); > šMODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol."); > > šstatic int w1_timeout = 10; > +static int w1_timeout_us = 0; > šint w1_max_slave_count = 64; > šint w1_max_slave_ttl = 10; > > šmodule_param_named(timeout, w1_timeout, int, 0); > šMODULE_PARM_DESC(timeout, "time in seconds between automatic slave searches"); > +module_param_named(timeout_us, w1_timeout_us, int, 0); > +MODULE_PARM_DESC(timeout, "time in microseconds between automatic slave" > + ššššššššš" searches"); > š/* A search stops when w1_max_slave_count devices have been found in that > šš* search. šThe next search will start over and detect the same set of devices > šš* on a static 1-wire bus. šMemory is not allocated based on this number, just > @@ -317,6 +321,14 @@ static ssize_t w1_master_attribute_show_timeout(struct device *dev, struct devic > šššššššššreturn count; > š} > > +static ssize_t w1_master_attribute_show_timeout_us(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + ssize_t count; > + count = sprintf(buf, "%d\n", w1_timeout_us); > + return count; > +} > + > šstatic ssize_t w1_master_attribute_store_max_slave_count(struct device *dev, > šššššššššstruct device_attribute *attr, const char *buf, size_t count) > š{ > @@ -543,6 +555,7 @@ static W1_MASTER_ATTR_RO(slave_count, S_IRUGO); > šstatic W1_MASTER_ATTR_RW(max_slave_count, S_IRUGO | S_IWUSR | S_IWGRP); > šstatic W1_MASTER_ATTR_RO(attempts, S_IRUGO); > šstatic W1_MASTER_ATTR_RO(timeout, S_IRUGO); > +static W1_MASTER_ATTR_RO(timeout_us, S_IRUGO); > šstatic W1_MASTER_ATTR_RO(pointer, S_IRUGO); > šstatic W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUSR | S_IWGRP); > šstatic W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUSR | S_IWGRP); > @@ -556,6 +569,7 @@ static struct attribute *w1_master_default_attrs[] = { > ššššššššš&w1_master_attribute_max_slave_count.attr, > ššššššššš&w1_master_attribute_attempts.attr, > ššššššššš&w1_master_attribute_timeout.attr, > + &w1_master_attribute_timeout_us.attr, > ššššššššš&w1_master_attribute_pointer.attr, > ššššššššš&w1_master_attribute_search.attr, > ššššššššš&w1_master_attribute_pullup.attr, > @@ -1108,7 +1122,8 @@ int w1_process(void *data) > ššššššššš/* As long as w1_timeout is only set by a module parameter the sleep > šššššššššš* time can be calculated in jiffies once. > šššššššššš*/ > - const unsigned long jtime = msecs_to_jiffies(w1_timeout * 1000); > + const unsigned long jtime = > + šusecs_to_jiffies(w1_timeout * 1000000 + w1_timeout_us); > ššššššššš/* remainder if it woke up early */ > šššššššššunsigned long jremain = 0; > > -- > 2.3.5