All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Felipe Balbi <balbi@kernel.org>,
	linux-usb@vger.kernel.org, Greg KH <greg@kroah.com>,
	Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>
Subject: [v4,2/2] usb/gadget: Add driver for Aspeed SoC virtual hub
Date: Sat, 17 Mar 2018 09:50:30 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1803170943170.8154-100000@netrider.rowland.org> (raw)

On Sat, 17 Mar 2018, Benjamin Herrenschmidt wrote:

> On Fri, 2018-03-16 at 16:56 -0400, Alan Stern wrote:
> > On Fri, 16 Mar 2018, Benjamin Herrenschmidt wrote:
> > 
> > > On Thu, 2018-03-15 at 08:03 +1100, Benjamin Herrenschmidt wrote:
> > > > > > Do you have more comments for the rest of the driver or that's it ?
> > > > > 
> > > > > so far, that's it.
> > > > 
> > > > Ok. I'll re-send.
> > > 
> > > So I'll resend in a minute, doing a few more tests, however, I've
> > > noticed something which I wont' have time to track down til at
> > > best next week, I wonder if it's normal/expected.
> > > 
> > > If I just create a mass storage function set to be "removable" and
> > > "cdrom" with no file attached,  and enable it, I get an endless stream
> > > of resets. It looks like the host constantly does USB resets.
> > 
> > That's not why I get.  There's an endless stream of messages, but it
> > doesn't include any resets.  Just command failures and endpoint halts.  
> > For example:
> 
>  .../...
> 
> In my case, I was getting resets on the host:
> 
> [383250.844611] usb 1-1: new high-speed USB device number 84 using xhci_hcd
> [383250.972235] usb 1-1: New USB device found, idVendor=1d6b, idProduct=0107
> [383250.972244] usb 1-1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
> [383250.972251] usb 1-1: Product: USB Virtual Hub
> [383250.972257] usb 1-1: Manufacturer: Aspeed
> [383250.972262] usb 1-1: SerialNumber: 00000000
> [383250.979127] hub 1-1:1.0: USB hub found
> [383250.979218] hub 1-1:1.0: 5 ports detected
> [383284.910195] usb 1-1.1: new high-speed USB device number 85 using xhci_hcd
> [383284.988326] usb 1-1.1: New USB device found, idVendor=1d6b, idProduct=0104
> [383284.988339] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [383284.988349] usb 1-1.1: Product: Bar Gadget
> [383284.988358] usb 1-1.1: Manufacturer: Foo Inc.
> [383284.988366] usb 1-1.1: SerialNumber: 0123456789
> [383285.000159] usb-storage 1-1.1:1.0: USB Mass Storage device detected
> [383285.000613] scsi host3: usb-storage 1-1.1:1.0
> [383286.063152] scsi 3:0:0:0: CD-ROM            Linux    File-CD Gadget   0416 PQ: 0 ANSI: 2
> [383286.064148] sr 3:0:0:0: Power-on or device reset occurred
> [383286.129411] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383286.284397] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383286.438396] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383286.593487] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383286.676863] sr 3:0:0:0: [sr0] scsi-1 drive
> [383286.676871] cdrom: Uniform CD-ROM driver Revision: 3.20
> [383286.678558] sr 3:0:0:0: Attached scsi CD-ROM sr0
> [383286.679426] sr 3:0:0:0: Attached scsi generic sg2 type 5
> [383286.746343] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383286.901458] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383287.056423] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383287.211445] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383287.360422] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383287.516295] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383287.671464] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383287.827423] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> [383287.912048] sr 3:0:0:0: Power-on or device reset occurred
> [383288.013376] usb 1-1.1: reset high-speed USB device number 85 using xhci_hcd
> 
> The guest just show config selection messages. I'll dig a bit next week
> in case there's an issue with my UDC driver there.

Output from usbmon could help.

> As for ...
> 
> > It's worth pointing out that all those messages are at DEBUG level.  
> > Although they fill up the kernel's log buffer, they won't be noticeable 
> > to most users.
> > 
> > In any case, g-mass-storage was never intended be a complete emulation 
> > of a CD or DVD drive.  Its support for those modes is minimal; it was 
> > originally intended just to emulate a hard disk drive.
> 
> Then it will be worthwhile me or somebody else spending a bit of time
> beefing it up a little bit. I'll see if I can spare time in the next
> couple of weeks.

Maybe...  Even after cdrom support was added to the gadget, the scope 
was limited.  It was intended to emulate _only_ a CD drive, not a DVD 
drive.

Also, if I'm not mistaken, the commands that the emulation doesn't 
handle are all optional.

Alan Stern

> The Aspeed chip is a BMC chip, ie server management processor, and is
> connected via the USB gadget to the actual server (the host). One of
> the usage scenario here is to use USB gadget to present distro ISOs as
> USB CD/DVDs to the host for remote provisioning (sourced over the
> network via something like nbd).
> 
> Note that due to the limitation of having to use a file or a block
> device, we might end up doing a userspace CDROM emulation instead that
> can source ISOs via things like HTTPS instead, but initially the above
> is what we are toying with.
> 
> Cheers,
> Ben.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-03-17 13:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-17 13:50 Alan Stern [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-20  4:36 [v4,2/2] usb/gadget: Add driver for Aspeed SoC virtual hub Benjamin Herrenschmidt
2018-03-17  0:40 Benjamin Herrenschmidt
2018-03-17  0:38 Benjamin Herrenschmidt
2018-03-17  0:29 Benjamin Herrenschmidt
2018-03-16 20:56 Alan Stern
2018-03-16  7:23 Felipe Balbi
2018-03-16  0:40 Benjamin Herrenschmidt
2018-03-14 21:03 Benjamin Herrenschmidt
2018-03-14  8:54 Felipe Balbi
2018-03-14  3:53 Benjamin Herrenschmidt
2018-03-12 22:35 Benjamin Herrenschmidt
2018-03-09  9:20 Felipe Balbi
2018-01-26  0:01 Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44L0.1803170943170.8154-100000@netrider.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=andrew@aj.id.au \
    --cc=balbi@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=greg@kroah.com \
    --cc=joel@jms.id.au \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.