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:	Tue, 15 Apr 2014 23:39:23 -0500
From:	Felipe Balbi <balbi@...com>
To:	Alan Stern <stern@...land.harvard.edu>
CC:	Felipe Balbi <balbi@...com>,
	sundeep subbaraya <sundeep.lkml@...il.com>,
	Subbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@...inx.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Michal Simek <michals@...inx.com>,
	Subbaraya Sundeep Bhatta <sbhatta@...inx.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH RFC] usb: gadget: Add xilinx axi usb2 device support

Hi,

On Tue, Apr 15, 2014 at 01:55:38PM -0400, Alan Stern wrote:
> On Tue, 15 Apr 2014, Felipe Balbi wrote:
> 
> > > 2. Does device need to know OUT transactions before hand so that OUT
> > > requests are queued for endpoint before packets are received
> > > from host?
> > 
> > well, no. Gadget driver shouldn't depend on that. That's UDC driver's
> > responsability to manage that. I mean, if host sends OUT token and
> > there's nothing in the out queue, then UDC need to start transfer as
> > soon as gadget driver queues the request. If, on the other hand, gadget
> > driver queues packet before host has sent OUT token then you have two
> > choices:
> > 
> > 1) start the transfer - most HW will wait for OUT token
> > 2) wait for out token
> 
> I'm not familiar with the variations in all the different UDC hardware.  
> Nevertheless, I wouldn't describe the situation in those terms.

OK, I've oversimplified... what I meant was that even if you start a
transfer at the UDC level, nothing will happen on the bus until HW sees
an OUT token. The buffer pointed to by req->buf won't get any writes,
DMA won't do anything.

On (2) I meant that some HW (e.g. dwc3) will assert the IRQ line once
they see a token for which they have to transfer descriptors in the
internal controller's cache.

> If an OUT transaction occurs and the gadget driver hasn't queued a
> request, the UDC hardware could store the incoming data in an internal
> buffer or it could NAK the transaction.  There aren't any other
> choices.  If there isn't enough space available in an internal buffer,
> the only possible action is NAK.

in HS there's also NYET

> Regardless, gadget drivers do not need to queue requests for OUT
> endpoints before the host starts sending data.  When the request does

they're not required, but they can. It's UDC driver's responsability to
start consuming the queue at the proper time.

> get queued, the UDC driver will make sure that the transfer takes
> place.

correct.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ