Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3405005yba; Mon, 8 Apr 2019 18:40:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxb3sdbahndFLkyS3gWd3CJwq+lUXAEPnbAZ2RHR7oaLFPe13DgoAl+zM+6xDINmNmBD7jo X-Received: by 2002:a17:902:1486:: with SMTP id k6mr34123996pla.3.1554774004010; Mon, 08 Apr 2019 18:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554774004; cv=none; d=google.com; s=arc-20160816; b=yt4XAxH92ls+9U4bhxNLj3JcSnj6EfBp5ZcBjxfQIaLrCU2SZvV7dCil5Jo/wzyMkM CJVsnwO637UgDehV0LOOgODt2qr9VAIkgNYtN24cv6DxU+fQZ5oBhFF5GKBuu8tXRqEy HpASmoCzsTZYaxonn8YhMoKRJ/op2tzobyytM7D+YWoj/Z7u2jTZEHgWbnpBVbFjDdZM ZBWGJCiR1x5+vEwwT9bd8wRXkTUwqOdhppCzrtahg7pVmemqdYooOL2mYPE5AYcWAjtD eeXsaQoUJ7R60YkDE3UTYW8XRmB2BwuejD5PWC6/fqcp+7OAJv7leYXHqjBIRttPxYJU fRBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=d5TnVyrLQrn9DjNefDFGnh2HmiO36ljOm5QbNBifWLY=; b=NWmu4+hceUNzUaOQ2nmknJjFOzHMnXvISTk63Pls8yFz9Z35PaJhVpFgZ/fIOeZQ4i vzisoHPMSr9Y2Du+V4+OHDOZE9iq0/PoucVc7jTibqaRAzSO+V+b28+mV65WHFFlGM1J l0+0hpWXum5PeGKu6D+5rzlSH8xOt5Ko+wseAqg9apOUpsad/QuTk9tEsbOVAACFzCQD N0ApsP9zDQphwuXNPZo0dTb2vljyRIoxa18Z6zOT2ZhjXSZ7mX714vkGahIYIqU9tyVD H4WiopK2CdVveeCfTWmwCmIAdNpzfx1UjWRF4+0WVG1r8lB7IJFeiUI5jqmiBXf8h4t4 92+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si27954303pfe.250.2019.04.08.18.39.48; Mon, 08 Apr 2019 18:40:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726588AbfDIBho (ORCPT + 99 others); Mon, 8 Apr 2019 21:37:44 -0400 Received: from 178.115.242.59.static.drei.at ([178.115.242.59]:35628 "EHLO mail.osadl.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725950AbfDIBhn (ORCPT ); Mon, 8 Apr 2019 21:37:43 -0400 Received: by mail.osadl.at (Postfix, from userid 1001) id 802B05C2174; Tue, 9 Apr 2019 03:36:56 +0200 (CEST) Date: Tue, 9 Apr 2019 03:36:56 +0200 From: Nicholas Mc Guire To: Adham.Abozaeid@microchip.com Cc: hofrat@osadl.org, Ajay.Kathat@microchip.com, gregkh@linuxfoundation.org, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] staging: wilc1000: give usleep_range a range Message-ID: <20190409013656.GA22293@osadl.at> References: <1554552067-15421-1-git-send-email-hofrat@osadl.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 08, 2019 at 09:10:00PM +0000, Adham.Abozaeid@microchip.com wrote: > Hi Nicholas > > On 4/6/19 5:01 AM, Nicholas Mc Guire wrote: > > External E-Mail > > > > > > Someone that knows the motivation for setting the time to 2 millisecond > > might need to check if the 2 milliseconds where seen as tollerable max or > > min - I'm assuming it was the min so extending. > > 2 msec is the time the chip takes to wake up from sleep. > > Increasing the maximum to 5 msec will impact the throughput since this call is on the transmit path. > ok - would it be tollerable to make it 2 - 2.5 ms ? even that would allow for the hrtimer subsystem to optimize a lot. In any case the min==max case gives you very little if you run a test-case with usleep_range(1000,1000) and a loop with usleep_range(1000,2000) and look at the distribution you will have a hard time seeing any difference. I doubt you would readily see the change from usleep_range(2000,2000) to usleep_range(2000,3000) in benchmarks - maybe (2000,5000) would be visible. My assumption (I have not analyzed it in detail) is that if you have a high re-use of existing timers that the setup of the timer is faster and thats why increasing the range > 0 can actually result in better jitter distribution. thx! hofrat > > diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c > > index c238969..42da533 100644 > > --- a/drivers/staging/wilc1000/wilc_wlan.c > > +++ b/drivers/staging/wilc1000/wilc_wlan.c > > @@ -408,7 +408,7 @@ void chip_wakeup(struct wilc *wilc) > > wilc->hif_func->hif_write_reg(wilc, 1, reg & ~BIT(1)); > > > > do { > > - usleep_range(2 * 1000, 2 * 1000); > > + usleep_range(2 * 1000, 5 * 1000); > > wilc_get_chipid(wilc, true); > > } while (wilc_get_chipid(wilc, true) == 0); > > } while (wilc_get_chipid(wilc, true) == 0); > > @@ -423,7 +423,7 @@ void chip_wakeup(struct wilc *wilc) > > &clk_status_reg); > > > > while ((clk_status_reg & 0x1) == 0) { > > - usleep_range(2 * 1000, 2 * 1000); > > + usleep_range(2 * 1000, 5 * 1000); > > > > wilc->hif_func->hif_read_reg(wilc, 0xf1, > > &clk_status_reg); > > > Thanks, > > Adham >