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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 4 Apr 2014 16:06:15 +0200
From:	Stanislaw Gruszka <sgruszka@...hat.com>
To:	Jakub Kiciński <moorray3@...pl>
Cc:	Richard Genoud <richard.genoud@...il.com>,
	Ivo van Doorn <IvDoorn@...il.com>,
	Gertjan van Wingerde <gwingerde@...il.com>,
	Helmut Schaa <helmut.schaa@...glemail.com>,
	"John W. Linville" <linville@...driver.com>,
	linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rt2x00: BUG: remove double loop on REGISTER_BUSY_COUNT

On Fri, Apr 04, 2014 at 11:01:06AM +0200, Jakub Kiciński wrote:
> On Fri, 4 Apr 2014 10:19:09 +0200, Stanislaw Gruszka wrote:
> > On Thu, Apr 03, 2014 at 05:37:01PM +0200, Jakub Kiciński wrote:
> > > On Thu,  3 Apr 2014 16:12:07 +0200, Richard Genoud wrote:
> > > > rt2x00usb_register_read_lock() calls rt2x00usb_vendor_req_buff_lock()
> > > > that calls rt2x00usb_vendor_request() which is already looping up to
> > > > REGISTER_BUSY_COUNT times.
> > > > 
> > > > So this loop is not needed.
> > > 
> > > Not true.  rt2x00usb_vendor_request() busy-waits for usb_control_msg()
> > > to succeed, rt2x00usb_register_read_lock() busy-waits for the register
> > > field itself to become 0.
> > 
> > Yeah, but still we are looping REGISTER_BUSY_COUNT*REGISTER_BUSY_COUNT
> > what seems to be far too long.
> 
> Yes, the busy waiting itself takes roughly 1s (100*100*100us) and then
> there are transfer times, so it might be too long indeed.  Vendor driver
> waits only 10 * 5ms in RTUSB_VendorRequest() so

We use "timeout" argument which is set to 500ms , so perhaps that
could be the reason why Richard sees "infinite" loop i.e.
100*100*(500ms + 100us)

> rt2x00usb_vendor_request() seems like a better place to cut down the
> number of loops.
>
> Alternatively we could make rt2x00usb_regbusy_read() check the retval
> from rt2x00usb_vendor_request() and exit early?

Make sense, but I think we should review the area and make some more
changes to fine tune the timeout of USB reg reading functions.

Stanislaw 
--
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