All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: "Abhishek Pandit-Subedi" <abhishekpandit@chromium.org>,
	"Łukasz Bartosik" <ukaszb@chromium.org>,
	"Benson Leung" <bleung@chromium.org>,
	"Jameson Thies" <jthies@google.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH v1 2/4] usb: typec: Add attribute file showing the USB Modes of the partner
Date: Wed, 9 Oct 2024 11:34:36 +0300	[thread overview]
Message-ID: <ZwZAHE9q9IGYOa80@kuha.fi.intel.com> (raw)
In-Reply-To: <quqy7fpn4e5hrikekfjirnid2joskyezzj72jgfkz2t6th7z7o@tknlic5vlywq>

On Sun, Oct 06, 2024 at 07:22:42PM +0300, Dmitry Baryshkov wrote:
> On Fri, Oct 04, 2024 at 05:04:37PM GMT, Heikki Krogerus wrote:
> > This attribute file shows the supported USB modes (USB 2.0,
> > USB 3.0 and USB4) of the partner, and the currently active
> > mode.
> > 
> > The active mode is determined primarily by checking the
> > speed of the enumerated USB device. When USB Power Delivery
> > is supported, the active USB mode should be always the mode
> > that was used with the Enter_USB Message, regardless of the
> > result of the USB enumeration. The port drivers can
> > separately assign the mode with a dedicated API.
> > 
> > If USB Power Delivery Identity is supplied for the partner
> > device, the supported modes are extracted from it.
> > 
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > ---
> >  Documentation/ABI/testing/sysfs-class-typec |  14 +++
> >  drivers/usb/typec/class.c                   | 123 +++++++++++++++++++-
> >  drivers/usb/typec/class.h                   |   2 +
> >  include/linux/usb/typec.h                   |   5 +
> >  4 files changed, 140 insertions(+), 4 deletions(-)
> 
> I think the use of port->usbN_dev is racy and not always obviouos.
> For example  on Qualcomm devices I ended up with no partner's
> usb_capability and just 'usb2' in usb_mode even though the partner uses
> USB3 mode. Maybe it's better to hide usb_mode completely if we can not
> properly determine the actual mode?
> 
> (On Qualcomm devices there is no working ACPI, so there is no USB <->
> typec correlationship (yet)).

Sure. Let's keep it hidden in that case.

thanks,

-- 
heikki

  reply	other threads:[~2024-10-09  8:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 14:04 [PATCH v1 0/3] usb: typec: USB Modes Heikki Krogerus
2024-10-04 14:04 ` [PATCH v1 1/4] usb: typec: Add attribute file showing the supported USB modes of the port Heikki Krogerus
2024-10-06 16:35   ` Dmitry Baryshkov
2024-10-04 14:04 ` [PATCH v1 2/4] usb: typec: Add attribute file showing the USB Modes of the partner Heikki Krogerus
2024-10-05  7:25   ` kernel test robot
2024-10-06 16:22   ` Dmitry Baryshkov
2024-10-09  8:34     ` Heikki Krogerus [this message]
2024-10-04 14:04 ` [PATCH v1 3/4] usb: typec: ucsi: Supply the USB capabilities to the ports Heikki Krogerus
2024-10-06 16:36   ` Dmitry Baryshkov
2024-10-04 14:04 ` [PATCH v1 4/4] usb: typec: ucsi: Add support for the partner USB Modes Heikki Krogerus

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=ZwZAHE9q9IGYOa80@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=abhishekpandit@chromium.org \
    --cc=bleung@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jthies@google.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=ukaszb@chromium.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.