lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAODwPW841PbmWDrrvO-k3HaCusSyKbgaBbvPRq9X5-m31Zws+w@mail.gmail.com>
Date:	Wed, 19 Nov 2014 11:27:25 -0800
From:	Julius Werner <jwerner@...omium.org>
To:	李云志 <lyz@...k-chips.com>
Cc:	Julius Werner <jwerner@...omium.org>,
	Alan Stern <stern@...land.harvard.edu>,
	Mathias Nyman <mathias.nyman@...ux.intel.com>,
	杨凯 <kever.yang@...k-chips.com>,
	Paul Zimmerman <paulz@...opsys.com>,
	Dinh Nguyen <dinguyen@...nsource.altera.com>,
	Romain Perier <romain.perier@...il.com>,
	Heiko Stuebner <heiko@...ech.de>,
	Douglas Anderson <dianders@...omium.org>,
	Sonny Rao <sonnyrao@...omium.org>,
	柯飞雄 <addy.ke@...k-chips.com>,
	蔡枫 <cf@...k-chips.com>,
	吴良峰 <wulf@...k-chips.com>,
	黄涛 <huangtao@...k-chips.com>,
	"open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
	李云志 <roy.li@...k-chips.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>, Felipe Balbi <balbi@...com>
Subject: Re: Re: [PATCH v2] usb: dwc2: resume root hub when device detect with
 suspend state

On Wed, Nov 19, 2014 at 1:47 AM, 李云志 <lyz@...k-chips.com> wrote:
> hi Julius & Alan
>
>     Shall we use dwc2's private status "hsotg->lx_state" here instesd of
> "hcd->state" for checking root hub is in suspend state ?
> I see the EHCI driver do something like this(ehci->rh_state ==
> EHCI_RH_SUSPENDED) before resume the root hub.

It's not this simple, because lx_state only relates to the status of
the one port on the DWC2. That may be suspended even though the root
hub is not.

The USB core differentiates between suspending individual ports, and
suspending the whole root hub (which should automatically suspend all
ports in a host-controller-specific manner). This distinction may seem
silly on DWC2 because there is only one port to suspend, but you still
need to make it so that the USB core doesn't get confused. So the
different things you need to keep track of are:

 * is the one port individually suspended (through the
hub_control(SetPortFeature(PORT_SUSPEND)) method)
 * is the root hub suspended (through calling bus_suspend())
 * if the root hub gets suspended (through bus_suspend()), had the
port already been suspended before that (through a earlier
hub_control())... this is the thing I mentioned in your other patch

You can decide whether you want to bake that all into one variable
somehow or make it three, but we need to be able to tell all of these
things apart. The third bullet point will also require you to prevent
races of hub_control() with bus_suspend() (not sure if the kernel
already guarantees that or not), so I think we may have to rethink the
way the spinlock works (because it currently doesn't cover that).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ