linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
To: Zhuang Jin Can <jin.can.zhuang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	pmladek-AlSwsSmVLrQ@public.gmane.org,
	peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] usb: core: add usb3 lpm sysfs
Date: Wed, 29 Apr 2015 13:06:22 +0200	[thread overview]
Message-ID: <20150429110622.GA26820@kroah.com> (raw)
In-Reply-To: <20150429105730.GA12505-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

On Wed, Apr 29, 2015 at 06:57:30PM +0800, Zhuang Jin Can wrote:
> On Wed, Apr 29, 2015 at 11:01:48AM +0200, Greg KH wrote:
> > On Wed, Apr 29, 2015 at 03:20:04PM +0800, Zhuang Jin Can wrote:
> > > On Tue, Apr 28, 2015 at 11:11:10PM +0200, Greg KH wrote:
> > > > On Wed, Apr 29, 2015 at 12:51:27AM +0800, Zhuang Jin Can wrote:
> > > > > Hi Greg KH,
> > > > > 
> > > > > On Tue, Apr 28, 2015 at 12:42:24PM +0200, Greg KH wrote:
> > > > > > On Sun, Apr 19, 2015 at 11:46:12AM +0800, Zhuang Jin Can wrote:
> > > > > > > Some usb3 devices may not support usb3 lpm well.
> > > > > > > The patch adds a sysfs to enable/disable u1 or u2 of the port.The
> > > > > > > settings apply to both before and after device enumeration.
> > > > > > > Supported values are "0" - u1 and u2 are disabled, "u1" - only u1 is
> > > > > > > enabled, "u2" - only u2 is enabled, "u1_u2" - u1 and u2 are enabled.
> > > > > > > 
> > > > > > > The interface is useful for testing some USB3 devices during
> > > > > > > development, and provides a way to disable usb3 lpm if the issues can
> > > > > > > not be fixed in final products.
> > > > > > 
> > > > > > How is a user supposed to "know" to make this setting for a device?  Why
> > > > > > can't the kernel automatically set this value properly?  Why does it
> > > > > > need to be a kernel issue at all?
> > > > > > 
> > > > > By default kernel enables u1 u2 of all USB3 devices. This interface
> > > > > provides the user to change this policy. User may set the policy
> > > > > according to PID/VID of uevent or according to the platform information
> > > > > known by userspace.
> > > > 
> > > > And why would they ever want to do that?
> > > > 
> > > > > It's not a kernel issue, as u1 u2 is mandatory by USB3 compliance. But
> > > > > for some internal hardwired USB3 connection, e.g. SSIC, passing USB3
> > > > > compliance is not mandatory. So the interface provides a way for vendor
> > > > > to ship with u1 or u2 broken products. Of course, this is not encouraged :).
> > > > 
> > > > If the state is broken for those devices, we can't require the user to
> > > > fix it for us, the kernel should do it automatically.
> > > > 
> > > > > > And when you are doing development of broken devices, the kernel doesn't
> > > > > > have to support you, you can run with debugging patches of your own
> > > > > > until you fix your firmware :)
> > > > > > 
> > > > > Understood. But I think other vendor or developer may face the same
> > > > > issue in final product shipment or during development. Moreover, the
> > > > > interface provide the flexibility for developer to separately
> > > > > disable/enable u1 or u2, e.g. If they're debugging an u2 issue, they
> > > > > can disable u1 to simplify the situtation.
> > > > 
> > > > For debugging only, perhaps, but for a "normal" user, please let's
> > > > handle this automatically and don't create a switch that never gets used
> > > > by anyone or anything.
> > > > 
> > > Thanks Greg. Since so far the patch has no interesting value to the
> > > community, I'll drop the patch.
> > 
> > I didn't say that, I said it needed some more work to be accepted.
> Sorry for misunderstanding. Let me explain more why we need this interface.
> 
> We have a modem USB3 device (in stepping C) hardwired to one specific port of xHCI.
> The device was expected to work with u1 u2, however, due to a HW issue, it doesn't
> work stably. To workaround the issue, we let the init.rc script disable u1 u2 for
> this specific port.

Modern Linux systems don't have init.rc scripts anymore :)

> Then maybe we want to start debug u1 issue first, to avoid hitting u2 issue,
> we can disable u2. After u1 issue is resolved, we can enable back u2 to continue to
> debug u2 issue. This provides the flexibility to isolate u1 u2 debugging.
> This is valuable I think :)

I agree.

> The HW issue will be fixed in stepping D, however C and D will have the same PID/VID.
> There's no way for kernel to know the difference between C and D.
> Even after fixing in D, C will still be used for development (to save money..)

That sounds like a big design flaw, what about looking at the version of
the device?  That's what that field in the USB descriptors is for.

> If somehow finally we decide to ship stepping C (suppose HW issue can't be fixed in D in time),
> we'll have to disable both u1 and u2.
> 
> If we fix only u1 issue, we can just disable u2, etc..
> 
> To summarize, it provide users an opptunity to change the u1 u2 policy to
> debug and ship broken products.

That's good, but you need to do it somehow "automatically", as again,
systems don't have a init.rc file anymore :)

thanks,

greg k-h

  parent reply	other threads:[~2015-04-29 11:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-19  3:46 [PATCH] usb: core: add usb3 lpm sysfs Zhuang Jin Can
2015-04-22  9:21 ` Zhuang Jin Can
     [not found] ` <20150419034612.GA31576-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-04-28 10:42   ` Greg KH
2015-04-28 16:51     ` Zhuang Jin Can
2015-04-28 21:11       ` Greg KH
     [not found]         ` <20150428211110.GA32383-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-04-29  7:20           ` Zhuang Jin Can
     [not found]             ` <20150429072004.GA20961-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-04-29  9:01               ` Greg KH
     [not found]                 ` <20150429090148.GA22743-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-04-29 10:57                   ` Zhuang Jin Can
     [not found]                     ` <20150429105730.GA12505-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-04-29 11:06                       ` Greg KH [this message]
     [not found]                         ` <20150429110622.GA26820-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-04-29 16:21                           ` Zhuang Jin Can
     [not found]                             ` <20150429162132.GA21141-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-04-29 19:57                               ` Greg KH
     [not found]                                 ` <20150429195733.GA19183-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2015-04-30  8:49                                   ` Zhuang Jin Can

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=20150429110622.GA26820@kroah.com \
    --to=gregkh-hqyy1w1ycw8ekmwlsbkhg0b+6bgklq7r@public.gmane.org \
    --cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=jin.can.zhuang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=pmladek-AlSwsSmVLrQ@public.gmane.org \
    --cc=rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).