All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Michael Grzeschik <mgr@pengutronix.de>
Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org,
	kernel@pengutronix.de
Subject: Re: [PATCH v2] usb: hub: port: add sysfs entry to switch port power
Date: Thu, 2 Jun 2022 20:25:09 -0400	[thread overview]
Message-ID: <YplU5dHLZdQDGMh1@rowland.harvard.edu> (raw)
In-Reply-To: <20220602213454.GC26638@pengutronix.de>

On Thu, Jun 02, 2022 at 11:34:54PM +0200, Michael Grzeschik wrote:
> On Thu, Jun 02, 2022 at 03:16:27PM -0400, Alan Stern wrote:
> > On Thu, Jun 02, 2022 at 04:59:18PM +0200, Michael Grzeschik wrote:
> > > Because of that; I am currently curious if we just should rename that
> > > property to something more generic like "enable" or "disable". So that
> > > as the real vbus power switching is missing, the hubs port switching
> > > does still function like intended.
> > 
> > That makes sense.  But the question arises, does this patch really do what
> > you want?
> > 
> > The patch description talks about the need to disable devices or
> > re-enumerate them.  You can disable a device right now by writing -1 to
> > the bConfigurationValue sysfs file, and you can force a device to be
> > re-enumerated by resetting it (using the USBDEVFS_RESET usbfs ioctl).
> > 
> > About the only thing you can't currently do is actually turn off power to
> > the port.  This patch will allow users to do that, but only if the hub
> > supports power switching.
> > 
> > (Okay, there's one other thing: The patch also allows users to disable a
> > port, so that devices plugged into that port get ignored.  Maybe that's
> > what you really had in mind...?)
> 
> Yes, that is what I had in mind. If you agree, I would still keep the
> name "port_power" since it is the main function, but skip the
> hub_is_port_power_switchable check.

I favor the more generic name.  "disable" will be more understandable for 
users than "port_power", if the file doesn't actually control the bus 
power.

Alan Stern

      reply	other threads:[~2022-06-03  0:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02  1:27 [PATCH v2] usb: hub: port: add sysfs entry to switch port power Michael Grzeschik
2022-06-02 14:39 ` Alan Stern
2022-06-02 14:59   ` Michael Grzeschik
2022-06-02 19:16     ` Alan Stern
2022-06-02 21:34       ` Michael Grzeschik
2022-06-03  0:25         ` Alan Stern [this message]

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=YplU5dHLZdQDGMh1@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-usb@vger.kernel.org \
    --cc=mgr@pengutronix.de \
    /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.