public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Lan Tianyu <tianyu.lan@intel.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: gregkh@linuxfoundation.org, lenb@kernel.org,
	linux-usb@vger.kernel.org, linux-acpi@vger.kernel.org,
	sarah.a.sharp@linux.intel.com
Subject: Re: [RFC PATCH V3 3/3] usb : Add sysfs files to control usb port's power
Date: Thu, 07 Jun 2012 14:45:09 +0800	[thread overview]
Message-ID: <4FD04DF5.5060007@intel.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1206061020080.1788-100000@iolanthe.rowland.org>

On 2012年06月06日 22:21, Alan Stern wrote:
> On Wed, 6 Jun 2012, Lan Tianyu wrote:
>
>>> If "auto" does nothing, there's no reason to put it in this patch at
>>> all.  It could be added in a later patch, along with its
>>> implementation.
>> OK. I prefer to remove "auto" option in this patch. We can further discuss
>> the function of "auto".
>
> Sounds good.
>
> One more problem -- your implementation of "off" isn't quite right.
> You need to update hub_power_on() too.
>
How about this?

--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -861,7 +861,9 @@ static unsigned hub_power_on(struct usb_hub *hub, bool do_delay)
                 dev_dbg(hub->intfdev, "trying to enable port power on "
                                 "non-switchable hub\n");
         for (port1 = 1; port1 <= hub->descriptor->bNbrPorts; port1++)
-               set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER);
+               if (hub->port_data[port1 - 1].port_power_policy
+                               == USB_PORT_POWER_ON)
+                       set_port_feature(hub->hdev, port1, USB_PORT_FEAT_POWER);

         /* Wait at least 100 msec for power to become stable */
         delay = max(pgood_delay, (unsigned) 100);


> Alan Stern
>

-- 
Best Regards
Tianyu Lan
linux kernel enabling team
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-06-07  6:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1338799665-13997-1-git-send-email-tianyu.lan@intel.com>
2012-06-04  8:47 ` [RFC PATCH V3 2/3] USB/ACPI: Add usb port's acpi power control in the xhci PORT_POWER feature request process Lan Tianyu
2012-06-04  8:47 ` [RFC PATCH V3 3/3] usb : Add sysfs files to control usb port's power Lan Tianyu
     [not found]   ` <1338799665-13997-3-git-send-email-tianyu.lan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2012-06-04 15:02     ` Alan Stern
     [not found]       ` <Pine.LNX.4.44L0.1206041040510.1555-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-06-05  8:30         ` Lan Tianyu
2012-06-05 14:18           ` Alan Stern
     [not found]             ` <Pine.LNX.4.44L0.1206051017040.1542-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-06-05 15:58               ` Sarah Sharp
2012-06-06  1:53             ` Lan Tianyu
2012-06-06 14:21               ` Alan Stern
2012-06-07  6:45                 ` Lan Tianyu [this message]
2012-06-07 14:24                   ` Alan Stern

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=4FD04DF5.5060007@intel.com \
    --to=tianyu.lan@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sarah.a.sharp@linux.intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox