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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 8 May 2015 10:21:21 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	"Lu, Baolu" <baolu.lu@...ux.intel.com>
cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Mathias Nyman <mathias.nyman@...el.com>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/3] usb: notify hcd when USB device suspend or resume

On Fri, 8 May 2015, Lu, Baolu wrote:

> On 05/07/2015 10:34 PM, Alan Stern wrote:
> > On Thu, 7 May 2015, Lu, Baolu wrote:
> >
> >>>> +	void	(*device_suspend)(struct usb_hcd *, struct usb_device *udev,
> >>>> +			pm_message_t msg);
> >>>> +	void	(*device_resume)(struct usb_hcd *, struct usb_device *udev,
> >>>> +			pm_message_t msg);
> >>>>    };
> >>> Your callbacks don't use the msg argument.  What makes you think it is
> >>> needed?
> >> This msg argument is valuable. XHCI spec defines a capability named FSC
> >> (Force Save context Capability). When this capability is implemented, the
> >> Save State operation (do during host suspend) shall save any cached Slot,
> >> Endpoint, Stream or other Context information to memory. xHCI hcd could
> >> use this "msg" to determine whether it needs to issue stop endpoint with
> >> SP (suspend) bit set.
> > I don't understand.  What is the advantage of using FSC?
> 
> I'm sorry, I didn't make it clear.
> 
> As part of host suspend, controller save state will be issued to save
> host internal state in xhci_suspend():

...

> If FSC is supported,  the cached Slot, Endpoint, Stream, or other
> Context information are also saved.
> 
> Hence, when FSC is supported, software does not have to issue Stop
> Endpoint Command to push public and private endpoint state into
> memory as part of system suspend process.

Why do you have to push this state into memory at all?  Does the
controller hardware lose the cached state information when it is in low
power?

> The logic in xhci_device_suspend() will look like:
> 
> if xhci_device_suspend() callback was called due to system suspend,
> (mesg.event & PM_EVENT_SUSPEND is true) and FSC is supported by
> the xHC implementation, xhci_device_suspend() could ignore stop
> endpoint command, since CSS will be done in xhc_suspend() later and
> where all the endpoint caches will be pushed to memory.

I still don't understand this.  You said earlier that according
to section 4.15.1.1 of the xHCI spec, the endpoint rings should
_always_ be stopped with SP set when a device is suspended.  Now you're
saying that they don't need to be stopped during a system suspend if
the controller supports FSC.  (Or maybe you're saying they need to be 
stopped but SP doesn't need to be set -- it's hard to tell.)

So which is it?  Do you need to stop the endpoint rings?  Is it okay 
not to set SP?

Alan Stern

--
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