mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Oliver Neukum <oneukum@suse.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Rajaram R <rajaram.officemail@gmail.com>,
	Felipe Balbi <felipe.balbi@linux.intel.com>,
	Mathias Nyman <mathias.nyman@linux.intel.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [RFC PATCHv2] usb: USB Type-C Connector Class
Date: Mon, 23 May 2016 10:09:19 -0700	[thread overview]
Message-ID: <20160523170919.GB5964@roeck-us.net> (raw)
In-Reply-To: <1464002719.12181.42.camel@suse.com>

On Mon, May 23, 2016 at 01:25:19PM +0200, Oliver Neukum wrote:
> On Mon, 2016-05-23 at 12:57 +0300, Heikki Krogerus wrote:
> > Hi Oliver,
> > 
> > On Fri, May 20, 2016 at 04:19:59PM +0200, Oliver Neukum wrote:
> > > On Thu, 2016-05-19 at 15:44 +0300, Heikki Krogerus wrote:
> > > > Like I've told some of you guys, I'm trying to implement a bus for
> > > > the Alternate Modes, but I'm still nowhere near finished with that
> > > > one, so let's just get the class ready now. The altmode bus should in
> > > > any case not affect the userspace interface proposed in this patch.
> > > 
> > > Is this strictly divorced from USB PD?
> > 
> > The bus can not be tied to the USB PD stack we will have in the
> > kernel completely, or there is no change of using it with things like
> > UCSI. It's going to be difficult to achieve that in any case as we
> > simply won't be able to send and rescieve the VDMs with things like
> > UCSI, but let's see.
> > 
> > > How do you trigger a cable reset or a USB PD reset?
> > 
> > There needs to be an API, but I'm sure that's not going to be a
> > problem. The bus and the altmode specific drivers will reside inside
> > kernel.
> 
> Absolutely. But at some point we need to settle on an API.
> If I am to tell you whether your proposed API leaves out
> something that needs to be covered, I need to know what
> is to go into the other APIs.
> 
> A reset is a generic function, so it does not belong to specific
> drivers.
> 
A would expect the driver to execute the reset.

Maybe the question should be phrased differently: Even USCI (which
doesn't provide for everything) has commands to reset the policy
manager and to reset the connector. The class should provide a means
to execute those commands.

> > But I'm getting the sense that you are thinking about having some
> > responsibility of USB PD in userspace. Please correct me if I'm wrong.
> 
> Gods help us all if we are ready to do that.
> It would fail.
> Yet I think the idea that PD and Alternate Modes can be cleanly
> divorced is wrong. The selection of Alternate Modes is done by
> USB PD messages. We can encapsulate that, but we cannot leave it out,
> especially in the area of resets.
> 
> > I don't think it will be possible. I think the role of userspace can
> > only be the source for high level requests via this interface, like
> > enter/exit mode and swap role, and receiving the status and details of
> > the ports, but any knowledge about the requirements regarding those
> > steps belongs to the kernel. This includes also the knowledge about
> 
> Yes.
> 
> > stuff like mode dependencies, for example if cable plug has to be in a
> > certain mode in order for the partner to be able to enter some
> > specific mode, etc.
> 
> Yes.
> 
> So for Alternate Modes we need on a high level the following features
> 
> 1. discovery of available Alternate Modes
> 2. selection of an Alternate Mode
> 3. notification about entering an Alternate Mode
> 4. triggering a reset
> 5. notification about resets
> 
> 6. discovery about the current role
> 7. switching roles
> 8. setting preferred roles (Try.SRC and Try.SNK)
> 

Isn't reset and role handling orthogonal to alternate mode functionality ?
Both will still be needed even if alternate mode support is not implemented
at all.

> You covered 1. and 2.
> 3. can be covered by specific drivers
> 4. and 5. are not covered (and it makes no sense to tie it
> to specific drivers)
> 
> 6. and 7. is covered
> 8. is not
> 
> And 8. needs to be covered. It affects who selects the Alternate Mode.

Doesn't the actual role determine that ? A device which prefers to be
a DFP might still end up as UFP.

> You cannot tie it to USB and it doesn't fit with pure PD stuff.
> 
> I like your API as it is now. But it is incomplete.
> 

Same here.

Thanks,
Guenter

  reply	other threads:[~2016-05-23 17:09 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 12:44 Heikki Krogerus
2016-05-19 14:47 ` Oliver Neukum
2016-05-20 11:24   ` Heikki Krogerus
2016-05-20 13:37     ` Oliver Neukum
2016-05-21  5:51       ` Guenter Roeck
2016-05-21  6:43         ` Oliver Neukum
2016-05-22 15:54           ` Guenter Roeck
2016-05-23  5:34             ` Oliver Neukum
2016-05-23 13:27               ` Guenter Roeck
2016-05-23 13:58                 ` Oliver Neukum
2016-05-23 14:43                   ` Guenter Roeck
2016-05-23 15:55                     ` Oliver Neukum
2016-05-23 16:52                       ` Guenter Roeck
2016-05-24 10:08                         ` Heikki Krogerus
2016-05-24 10:18                           ` Oliver Neukum
2016-05-24 11:04                             ` Heikki Krogerus
2016-05-19 14:48 ` Oliver Neukum
2016-05-19 15:43   ` Greg KH
2016-05-20 10:58     ` Heikki Krogerus
2016-05-19 17:53 ` Guenter Roeck
2016-05-20 10:47   ` Heikki Krogerus
2016-05-20 17:02     ` Guenter Roeck
2016-05-23  9:23       ` Heikki Krogerus
2016-05-20 14:19 ` Oliver Neukum
2016-05-23  9:57   ` Heikki Krogerus
2016-05-23 11:25     ` Oliver Neukum
2016-05-23 17:09       ` Guenter Roeck [this message]
2016-05-24  9:06         ` Oliver Neukum
2016-05-24  9:32       ` Heikki Krogerus
2016-05-24 12:51 ` Oliver Neukum
2016-05-25 11:28   ` Heikki Krogerus
2016-05-25 15:19     ` Guenter Roeck
2016-05-27  7:30       ` Heikki Krogerus
2016-05-24 13:42 ` Guenter Roeck
2016-05-25 11:30   ` Heikki Krogerus
2016-05-25 13:12     ` Guenter Roeck
2016-05-24 19:28 ` Guenter Roeck
2016-05-25 11:51   ` Heikki Krogerus
2016-05-25 13:21     ` Guenter Roeck
2016-05-25 14:04       ` Heikki Krogerus
2016-05-25 14:20         ` Oliver Neukum
2016-05-25 14:59           ` Guenter Roeck
2016-05-27  7:29             ` Heikki Krogerus
2016-05-25 18:35 ` [RFC PATCH] usb: typec: Various API updates and fixes Guenter Roeck
2016-05-27  7:55   ` Heikki Krogerus
2016-05-27 14:06     ` Guenter Roeck
2016-05-30 12:48       ` Heikki Krogerus
2016-05-30 13:19 ` [RFC PATCHv2] usb: USB Type-C Connector Class Heikki Krogerus
2016-05-30 13:59   ` Oliver Neukum
2016-05-31  8:31     ` Heikki Krogerus
2016-05-31  8:48       ` Oliver Neukum
2016-05-31 12:09         ` Heikki Krogerus
2016-05-31 12:43           ` Heikki Krogerus
2016-05-31 17:20             ` Guenter Roeck
2016-06-01  8:23               ` Heikki Krogerus
2016-06-01  8:31                 ` Oliver Neukum
2016-06-01  9:04                 ` Oliver Neukum
2016-06-01 13:34                   ` Guenter Roeck
2016-06-02  6:24                     ` Oliver Neukum
2016-06-02  6:37                       ` Guenter Roeck
2016-06-02  7:43                         ` Oliver Neukum
2016-05-31 17:14       ` Guenter Roeck
2016-06-01  9:26 ` Oliver Neukum
2016-06-01 23:29   ` Guenter Roeck
2016-06-02  6:30     ` Oliver Neukum
2016-06-02  8:27       ` Heikki Krogerus
2016-06-02 10:18     ` Heikki Krogerus
2016-06-02 16:12       ` Guenter Roeck
2016-06-03 13:21         ` Heikki Krogerus
2016-06-03 13:51           ` Guenter Roeck
2016-06-03 15:17             ` Heikki Krogerus
2016-06-03 18:39               ` Guenter Roeck
2016-06-06 13:28                 ` Heikki Krogerus
2016-06-06 13:35                   ` Oliver Neukum
2016-06-07  8:23                     ` Heikki Krogerus
2016-06-07 16:57                   ` Guenter Roeck
2016-06-02  8:02   ` Heikki Krogerus
2016-06-03 20:20 ` Pavel Machek
2016-06-06 13:45   ` Heikki Krogerus
2016-06-06 14:41     ` Greg KH
2016-06-07  8:25       ` Heikki Krogerus
2016-06-06 16:02     ` Guenter Roeck
2016-06-10 14:34 ` [RFC PATCHv3] " Heikki Krogerus
2016-06-11  7:05   ` Oliver Neukum
2016-06-11 18:03     ` Guenter Roeck
2016-06-13  7:49       ` Heikki Krogerus
2016-06-13  7:48     ` Heikki Krogerus
2016-06-21 13:08 ` [RFC PATCHv2] " Oliver Neukum
2016-06-21 13:24   ` Guenter Roeck
2016-06-21 19:43     ` Oliver Neukum
2016-06-21 21:37       ` Guenter Roeck
2016-06-21 13:58   ` Heikki Krogerus
2016-06-21 20:43     ` Oliver Neukum
2016-06-22  9:31       ` Heikki Krogerus
2016-06-22 10:08         ` Oliver Neukum
2016-06-22 11:19           ` Heikki Krogerus
2016-08-07 21:37           ` Pavel Machek
2016-08-08  8:52             ` Oliver Neukum

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=20160523170919.GB5964@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andy.shevchenko@gmail.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=oneukum@suse.com \
    --cc=rajaram.officemail@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®