lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 10 Feb 2015 10:23:41 -0800
From:	Julius Werner <jwerner@...omium.org>
To:	Felipe Balbi <balbi@...com>
Cc:	Yunzhi Li <lyz@...k-chips.com>, johnyoun@...opsys.com,
	gregory.herrero@...el.com, yousaf.kaukab@...el.com,
	r.baldyga@...sung.com,
	Dinh Nguyen <dinguyen@...nsource.altera.com>,
	Eddie Cai <cf@...k-chips.com>, Lin Huang <hl@...k-chips.com>,
	wulf <wulf@...k-chips.com>,
	杨凯 <yk@...k-chips.com>,
	Tao Huang <huangtao@...k-chips.com>, walkrain@....com,
	Douglas Anderson <dianders@...omium.org>,
	Julius Werner <jwerner@...omium.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v1] usb: dwc2: reduce dwc2 driver probe time

> @@ -2703,7 +2703,7 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg)
>         gusbcfg = readl(hsotg->regs + GUSBCFG);
>         gusbcfg &= ~GUSBCFG_FORCEHOSTMODE;
>         writel(gusbcfg, hsotg->regs + GUSBCFG);
> -       usleep_range(100000, 150000);
> +       usleep_range(25000, 50000);

The point of usleep_range() is to coalesce multiple timer interrupts
in idle systems for power efficiency. It's pretty pointless/harmful
during probe anyway and there's almost never a reason to make the span
larger than a few milliseconds. You should reduce this to something
reasonable (e.g. usleep_range(25000, 26000) or even
usleep_range(25000, 25000)) to save another chunk of time. Same
applies to other delays above.

> do you know what's the upper boundary for AHB clock ? How fast can it
> be? It's not wise to change timers because "it works on my RK3288
> board", you need to guarantee that this won't break anybody else.

But this code is already a loop that spins on the AHBIdle bit, right?
It should work correctly regardless of the delay. The only question is
whether the code could be more efficient with a longer sleep... but
since the general recommendation is to delay for ranges less than
10us, and the AHB clock would need to be lower than 100KHz (the ones I
see are usually in the range of tens or hundreds of MHz) to take
longer than that, this seems reasonable to me.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ