* [PATCH] usb: musb: PM: fix context save/restore in suspend/resume path
@ 2011-11-23 1:18 Kevin Hilman
2011-11-24 9:25 ` Felipe Balbi
2011-11-24 9:27 ` Felipe Balbi
0 siblings, 2 replies; 3+ messages in thread
From: Kevin Hilman @ 2011-11-23 1:18 UTC (permalink / raw)
To: Felipe Balbi
Cc: linux-omap, Greg Kroah-Hartman, open list:MUSB MULTIPOINT H...,
open list
Currently the driver tries to save context in the suspend path, but
will cause an abort if the device is already runtime suspended. This
happens, for example, if MUSB loaded/compiled-in, in host mode, but no
USB devices are attached. MUSB will be runtime suspended, but then
attempting a system suspend will crash due to the context save
being attempted while the device is disabled.
On OMAP, as of v3.1, the driver's ->runtime_suspend() callback will be
called late in the suspend path (by the PM domain layer) if the driver
is not already runtime suspended, ensuring a full shutdown.
Therefore, the context save is not needed in the ->suspend() method
since it will be called in the ->runtime_suspend() method anyways
(similarily for resume.)
NOTE: this leaves the suspend/resume methods basically empty (with
some FIXMEs and comments, but I'll leave it to the maintainers
to decide whether to remove them.
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
drivers/usb/musb/musb_core.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 20a2873..a057a5a 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2302,18 +2302,12 @@ static int musb_suspend(struct device *dev)
*/
}
- musb_save_context(musb);
-
spin_unlock_irqrestore(&musb->lock, flags);
return 0;
}
static int musb_resume_noirq(struct device *dev)
{
- struct musb *musb = dev_to_musb(dev);
-
- musb_restore_context(musb);
-
/* for static cmos like DaVinci, register values were preserved
* unless for some reason the whole soc powered down or the USB
* module got reset through the PSC (vs just being disabled).
--
1.7.6
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] usb: musb: PM: fix context save/restore in suspend/resume path
2011-11-23 1:18 [PATCH] usb: musb: PM: fix context save/restore in suspend/resume path Kevin Hilman
@ 2011-11-24 9:25 ` Felipe Balbi
2011-11-24 9:27 ` Felipe Balbi
1 sibling, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2011-11-24 9:25 UTC (permalink / raw)
To: Kevin Hilman
Cc: Felipe Balbi, linux-omap, Greg Kroah-Hartman,
open list:MUSB MULTIPOINT H..., open list
[-- Attachment #1: Type: text/plain, Size: 1166 bytes --]
Hi,
On Tue, Nov 22, 2011 at 05:18:24PM -0800, Kevin Hilman wrote:
> Currently the driver tries to save context in the suspend path, but
> will cause an abort if the device is already runtime suspended. This
> happens, for example, if MUSB loaded/compiled-in, in host mode, but no
> USB devices are attached. MUSB will be runtime suspended, but then
> attempting a system suspend will crash due to the context save
> being attempted while the device is disabled.
>
> On OMAP, as of v3.1, the driver's ->runtime_suspend() callback will be
> called late in the suspend path (by the PM domain layer) if the driver
> is not already runtime suspended, ensuring a full shutdown.
>
> Therefore, the context save is not needed in the ->suspend() method
> since it will be called in the ->runtime_suspend() method anyways
> (similarily for resume.)
>
> NOTE: this leaves the suspend/resume methods basically empty (with
> some FIXMEs and comments, but I'll leave it to the maintainers
> to decide whether to remove them.
>
> Signed-off-by: Kevin Hilman <khilman@ti.com>
3.1 ? so this should go to stable too, right ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: musb: PM: fix context save/restore in suspend/resume path
2011-11-23 1:18 [PATCH] usb: musb: PM: fix context save/restore in suspend/resume path Kevin Hilman
2011-11-24 9:25 ` Felipe Balbi
@ 2011-11-24 9:27 ` Felipe Balbi
1 sibling, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2011-11-24 9:27 UTC (permalink / raw)
To: Kevin Hilman
Cc: Felipe Balbi, linux-omap, Greg Kroah-Hartman,
open list:MUSB MULTIPOINT H..., open list
[-- Attachment #1: Type: text/plain, Size: 1208 bytes --]
Hi,
On Tue, Nov 22, 2011 at 05:18:24PM -0800, Kevin Hilman wrote:
> Currently the driver tries to save context in the suspend path, but
> will cause an abort if the device is already runtime suspended. This
> happens, for example, if MUSB loaded/compiled-in, in host mode, but no
> USB devices are attached. MUSB will be runtime suspended, but then
> attempting a system suspend will crash due to the context save
> being attempted while the device is disabled.
>
> On OMAP, as of v3.1, the driver's ->runtime_suspend() callback will be
> called late in the suspend path (by the PM domain layer) if the driver
> is not already runtime suspended, ensuring a full shutdown.
>
> Therefore, the context save is not needed in the ->suspend() method
> since it will be called in the ->runtime_suspend() method anyways
> (similarily for resume.)
>
> NOTE: this leaves the suspend/resume methods basically empty (with
> some FIXMEs and comments, but I'll leave it to the maintainers
> to decide whether to remove them.
>
> Signed-off-by: Kevin Hilman <khilman@ti.com>
applied, thanks.
I've added Cc: stable@vger.kernel.org so that this goes to v3.1 too.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-24 9:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 1:18 [PATCH] usb: musb: PM: fix context save/restore in suspend/resume path Kevin Hilman
2011-11-24 9:25 ` Felipe Balbi
2011-11-24 9:27 ` Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox