All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julius Werner <jwerner@chromium.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alexandru M Stan <amstan@chromium.org>,
	USB list <linux-usb@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Felipe Balbi <balbi@kernel.org>,
	Doug Anderson <dianders@chromium.org>,
	Julius Werner <jwerner@chromium.org>,
	Evan Green <evgreen@chromium.org>
Subject: Re: Splitting 1 USB port between 2 devices
Date: Fri, 29 May 2020 13:44:37 -0700	[thread overview]
Message-ID: <CAODwPW9=h5wXsFDwWiZcpCBkhxiJ=QJyo5hGHVUcgBL3Q9AxSQ@mail.gmail.com> (raw)
In-Reply-To: <20200529081243.GA827304@kroah.com>

> > My question here is: is this legal as far as Linux is concerned? Can 2
> > devices be enumerated under one physical port (even though we're
> > talking about separate usb2.0 and 3.0 bus topologies).
>
> Is it "legal" as far as the USB spec is concerned?  I would try to
> answer that first before worrying about if Linux can handle it or not :)

I don't think the question gets specifically addressed. It does at
least say this: 'A USB hub is the logical combination of two hubs: a
USB 2.0 hub and an Enhanced SuperSpeed hub. Each hub operates
independently on a separate data bus. Typically, the only signal
shared logic between them is to control VBUS.'

> > Is there any weird port reset interaction that might be annoying here?
> > I wouldn't want a reset on the usb 2.0 device to affect the 3.0
> > device.
>
> Which is why I don't think the hub would like this type of
> configuration, as who controls the power connections?  What happens if
> one device is suspended and the other isn't?

USB 3.2 spec also says: 'If either the USB 2.0 hub or Enhanced
SuperSpeed hub controllers requires a downstream port to be powered,
power is turned on for the port.'

Note that since we're talking internal devices only here, the hub
usually doesn't actually supply VBUS to the device anyway. Port power
controls should only matter for whether the port is logically turned
on or not. Suspend signalling uses the data pins so the expectation is
that it should be possible separately for the USB 3.0 and USB 2.0 side
(after all, when you suspend a 3.0 hub, you also suspend both halves
separately -- right?).

Of course since hub manufacturers probably don't expect this use case,
every hub you'd want to do this with would always have to be carefully
tested first. I think the main question here is whether Linux
architecturally assumes that every port on a 3.0 hub *needs* to have a
corresponding 2.0 port and they can't both be used for separate
devices, or whether it's going to add assumptions like that at some
point in the future. Like Alex said, running this seems to work fine
on Linux 5.4 right now. The question is just whether we can expect it
to stay that way and can consider this an allowed use case in Linux
(as long as the hardware supports it) -- i.e. if other changes get
added later that break this in software, could we submit fixes for
this use case or would we be told that device configurations like this
just aren't allowed in the first place?

  reply	other threads:[~2020-05-29 20:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 21:16 Splitting 1 USB port between 2 devices Alexandru M Stan
2020-05-29  8:03 ` Peter Chen
2020-05-29  8:12 ` Greg Kroah-Hartman
2020-05-29 20:44   ` Julius Werner [this message]
2020-05-29  8:46 ` Andrew Goodbody

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='CAODwPW9=h5wXsFDwWiZcpCBkhxiJ=QJyo5hGHVUcgBL3Q9AxSQ@mail.gmail.com' \
    --to=jwerner@chromium.org \
    --cc=amstan@chromium.org \
    --cc=balbi@kernel.org \
    --cc=dianders@chromium.org \
    --cc=evgreen@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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.