* [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume
@ 2013-10-18 9:39 Daniel Mack
2013-10-18 9:39 ` [PATCH v3 1/5] usb: musb: call musb_port_suspend from musb_bus_suspend Daniel Mack
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Daniel Mack @ 2013-10-18 9:39 UTC (permalink / raw)
To: linux-usb
Cc: linux-omap, neumann, bigeasy, vinod.koul, dan.j.williams, balbi,
Daniel Mack
v3 of my musb_dsps suspend patches.
With these patches applied, I can successfully bring an AM335x board
to suspend with a USB media connected, and access it again after
resume.
This works for both PIO mode and CPPI41 enabled configurations,
together with Sebasitian's and my cppi41 patches recently posted.
Felipe, this work was rebased and now applies cleanly on top of
your current 'next' branch. IOW, on top of "usb: musb: cppi41: allow
to defer probing if DMA isn't yet available".
Thanks,
Daniel
v2 -> v3
* dropped "usb: musb: move port reset to worker" which is
not crucial for this series.
* added another cosmetic cleanup patch (#5)
Daniel Mack (5):
usb: musb: call musb_port_suspend from musb_bus_suspend
usb: musb: conditionally save and restore the context on suspend
usb: musb: dsps: add {tx,rx}_mode to wrapper
usb: musb: dsps: add support for suspend and resume
usb: musb: dsps: indentation and whitespace fixes
drivers/usb/musb/musb_core.c | 17 +++++++-
drivers/usb/musb/musb_core.h | 1 +
drivers/usb/musb/musb_dsps.c | 86 +++++++++++++++++++++++++++++++++++------
drivers/usb/musb/musb_host.c | 2 +
drivers/usb/musb/musb_host.h | 4 ++
drivers/usb/musb/musb_virthub.c | 4 +-
include/linux/usb/musb.h | 1 +
7 files changed, 100 insertions(+), 15 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 1/5] usb: musb: call musb_port_suspend from musb_bus_suspend
2013-10-18 9:39 [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume Daniel Mack
@ 2013-10-18 9:39 ` Daniel Mack
2013-10-18 9:39 ` [PATCH v3 2/5] usb: musb: conditionally save and restore the context on suspend Daniel Mack
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Daniel Mack @ 2013-10-18 9:39 UTC (permalink / raw)
To: linux-usb
Cc: linux-omap, neumann, bigeasy, vinod.koul, dan.j.williams, balbi,
Daniel Mack
Make musb_port_suspend() externally available, and call it when to host
goes into suspend. This allows the core to go into suspend while a
device is connected.
Signed-off-by: Daniel Mack <zonque@gmail.com>
---
drivers/usb/musb/musb_host.c | 2 ++
drivers/usb/musb/musb_host.h | 2 ++
drivers/usb/musb/musb_virthub.c | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 9a2b8c8..2b60596 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -2433,6 +2433,8 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
struct musb *musb = hcd_to_musb(hcd);
u8 devctl;
+ musb_port_suspend(musb, true);
+
if (!is_host_active(musb))
return 0;
diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h
index 960d735..e660af9 100644
--- a/drivers/usb/musb/musb_host.h
+++ b/drivers/usb/musb/musb_host.h
@@ -92,6 +92,7 @@ extern void musb_host_rx(struct musb *, u8);
extern void musb_root_disconnect(struct musb *musb);
extern void musb_host_resume_root_hub(struct musb *musb);
extern void musb_host_poke_root_hub(struct musb *musb);
+extern void musb_port_suspend(struct musb *musb, bool do_suspend);
#else
static inline struct musb *hcd_to_musb(struct usb_hcd *hcd)
{
@@ -121,6 +122,7 @@ static inline void musb_root_disconnect(struct musb *musb) {}
static inline void musb_host_resume_root_hub(struct musb *musb) {}
static inline void musb_host_poll_rh_status(struct musb *musb) {}
static inline void musb_host_poke_root_hub(struct musb *musb) {}
+static inline void musb_port_suspend(struct musb *musb, bool do_suspend) {}
#endif
struct usb_hcd;
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
index 9af6bba..e977441 100644
--- a/drivers/usb/musb/musb_virthub.c
+++ b/drivers/usb/musb/musb_virthub.c
@@ -44,7 +44,7 @@
#include "musb_core.h"
-static void musb_port_suspend(struct musb *musb, bool do_suspend)
+void musb_port_suspend(struct musb *musb, bool do_suspend)
{
struct usb_otg *otg = musb->xceiv->otg;
u8 power;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 2/5] usb: musb: conditionally save and restore the context on suspend
2013-10-18 9:39 [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume Daniel Mack
2013-10-18 9:39 ` [PATCH v3 1/5] usb: musb: call musb_port_suspend from musb_bus_suspend Daniel Mack
@ 2013-10-18 9:39 ` Daniel Mack
2013-10-18 9:39 ` [PATCH v3 3/5] usb: musb: dsps: add {tx,rx}_mode to wrapper Daniel Mack
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Daniel Mack @ 2013-10-18 9:39 UTC (permalink / raw)
To: linux-usb
Cc: linux-omap, neumann, bigeasy, vinod.koul, dan.j.williams, balbi,
Daniel Mack
It appears not all platforms featuring a musb core need to save the musb
core registers at suspend time and restore them on resume.
The dsps platform does, however. So add a bit in struct
musb_hdrc_platform_data to let platforms specify their need of such
action being taken.
Signed-off-by: Daniel Mack <zonque@gmail.com>
---
drivers/usb/musb/musb_core.c | 17 ++++++++++++++++-
include/linux/usb/musb.h | 1 +
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index e5ad77d..fea6ecd 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2200,6 +2200,7 @@ static int musb_suspend(struct device *dev)
{
struct musb *musb = dev_to_musb(dev);
unsigned long flags;
+ struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
spin_lock_irqsave(&musb->lock, flags);
@@ -2213,16 +2214,30 @@ static int musb_suspend(struct device *dev)
*/
}
+ if (plat->restore_after_suspend)
+ musb_save_context(musb);
+
spin_unlock_irqrestore(&musb->lock, flags);
return 0;
}
static int musb_resume_noirq(struct device *dev)
{
- /* for static cmos like DaVinci, register values were preserved
+ struct musb *musb = dev_to_musb(dev);
+ struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
+
+ /*
+ * 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).
+ *
+ * The plaform data tells us about the necessity of saving and
+ * restoring the context across a suspend cycle.
*/
+
+ if (plat->restore_after_suspend)
+ musb_restore_context(musb);
+
return 0;
}
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index 053c268..296be6c 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -100,6 +100,7 @@ struct musb_hdrc_platform_data {
u8 mode;
u8 has_mailbox:1;
+ u8 restore_after_suspend:1;
/* for clk_get() */
const char *clock;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 3/5] usb: musb: dsps: add {tx,rx}_mode to wrapper
2013-10-18 9:39 [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume Daniel Mack
2013-10-18 9:39 ` [PATCH v3 1/5] usb: musb: call musb_port_suspend from musb_bus_suspend Daniel Mack
2013-10-18 9:39 ` [PATCH v3 2/5] usb: musb: conditionally save and restore the context on suspend Daniel Mack
@ 2013-10-18 9:39 ` Daniel Mack
2013-10-18 9:39 ` [PATCH v3 4/5] usb: musb: dsps: add support for suspend and resume Daniel Mack
[not found] ` <1382089175-13487-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
4 siblings, 0 replies; 12+ messages in thread
From: Daniel Mack @ 2013-10-18 9:39 UTC (permalink / raw)
To: linux-usb
Cc: linux-omap, neumann, bigeasy, vinod.koul, dan.j.williams, balbi,
Daniel Mack
rx_mode and tx_mode need to be read at suspend time and restored on
resume for dsps platforms. So add it to the wrapper struct first, and
initialize the values.
Signed-off-by: Daniel Mack <zonque@gmail.com>
---
drivers/usb/musb/musb_dsps.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 3cda7ad..da21a4e 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -83,6 +83,8 @@ struct dsps_musb_wrapper {
u16 coreintr_status;
u16 phy_utmi;
u16 mode;
+ u16 tx_mode;
+ u16 rx_mode;
/* bit positions for control */
unsigned reset:5;
@@ -605,6 +607,8 @@ static const struct dsps_musb_wrapper am33xx_driver_data = {
.coreintr_status = 0x34,
.phy_utmi = 0xe0,
.mode = 0xe8,
+ .tx_mode = 0x70,
+ .rx_mode = 0x74,
.reset = 0,
.otg_disable = 21,
.iddig = 8,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 4/5] usb: musb: dsps: add support for suspend and resume
2013-10-18 9:39 [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume Daniel Mack
` (2 preceding siblings ...)
2013-10-18 9:39 ` [PATCH v3 3/5] usb: musb: dsps: add {tx,rx}_mode to wrapper Daniel Mack
@ 2013-10-18 9:39 ` Daniel Mack
2013-10-18 9:58 ` Sebastian Andrzej Siewior
[not found] ` <1382089175-13487-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
4 siblings, 1 reply; 12+ messages in thread
From: Daniel Mack @ 2013-10-18 9:39 UTC (permalink / raw)
To: linux-usb
Cc: linux-omap, neumann, bigeasy, vinod.koul, dan.j.williams, balbi,
Daniel Mack
The dsps platform needs to save save some registers at suspend time and
restore them after resume. This patch adds a struct for these registers,
and also lets the musb core know that the core registers need to be
saved as well.
We also have to call musb_port_reset() for this platform upon resume, so
this function has to be made non-static.
Signed-off-by: Daniel Mack <zonque@gmail.com>
---
drivers/usb/musb/musb_core.h | 1 +
drivers/usb/musb/musb_dsps.c | 59 +++++++++++++++++++++++++++++++++++++++++
drivers/usb/musb/musb_host.h | 2 ++
drivers/usb/musb/musb_virthub.c | 2 +-
4 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 1c5bf75..ebb9058 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -294,6 +294,7 @@ struct musb {
irqreturn_t (*isr)(int, void *);
struct work_struct irq_work;
+
u16 hwvers;
u16 intrrxe;
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index da21a4e..ce5bbc6 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -112,6 +112,19 @@ struct dsps_musb_wrapper {
u8 poll_seconds;
};
+/*
+ * register shadow for suspend
+ */
+struct dsps_context {
+ u32 control;
+ u32 epintr;
+ u32 coreintr;
+ u32 phy_utmi;
+ u32 mode;
+ u32 tx_mode;
+ u32 rx_mode;
+};
+
/**
* DSPS glue structure.
*/
@@ -121,6 +134,8 @@ struct dsps_glue {
const struct dsps_musb_wrapper *wrp; /* wrapper register offsets */
struct timer_list timer; /* otg_workaround timer */
unsigned long last_timer; /* last timer data for each instance */
+
+ struct dsps_context context;
};
static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
@@ -506,6 +521,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
}
pdata.config = config;
pdata.platform_ops = &dsps_ops;
+ pdata.restore_after_suspend = 1;
config->num_eps = get_int_prop(dn, "mentor,num-eps");
config->ram_bits = get_int_prop(dn, "mentor,ram-bits");
@@ -632,11 +648,54 @@ static const struct of_device_id musb_dsps_of_match[] = {
};
MODULE_DEVICE_TABLE(of, musb_dsps_of_match);
+#ifdef CONFIG_PM
+static int dsps_suspend(struct device *dev)
+{
+ struct dsps_glue *glue = dev_get_drvdata(dev);
+ const struct dsps_musb_wrapper *wrp = glue->wrp;
+ struct musb *musb = platform_get_drvdata(glue->musb);
+ void __iomem *mbase = musb->ctrl_base;
+
+ glue->context.control = dsps_readl(mbase, wrp->control);
+ glue->context.epintr = dsps_readl(mbase, wrp->epintr_set);
+ glue->context.coreintr = dsps_readl(mbase, wrp->coreintr_set);
+ glue->context.phy_utmi = dsps_readl(mbase, wrp->phy_utmi);
+ glue->context.mode = dsps_readl(mbase, wrp->mode);
+ glue->context.tx_mode = dsps_readl(mbase, wrp->tx_mode);
+ glue->context.rx_mode = dsps_readl(mbase, wrp->rx_mode);
+
+ return 0;
+}
+
+static int dsps_resume(struct device *dev)
+{
+ struct dsps_glue *glue = dev_get_drvdata(dev);
+ const struct dsps_musb_wrapper *wrp = glue->wrp;
+ struct musb *musb = platform_get_drvdata(glue->musb);
+ void __iomem *mbase = musb->ctrl_base;
+
+ dsps_writel(mbase, wrp->control, glue->context.control);
+ dsps_writel(mbase, wrp->epintr_set, glue->context.epintr);
+ dsps_writel(mbase, wrp->coreintr_set, glue->context.coreintr);
+ dsps_writel(mbase, wrp->phy_utmi, glue->context.phy_utmi);
+ dsps_writel(mbase, wrp->mode, glue->context.mode);
+ dsps_writel(mbase, wrp->tx_mode, glue->context.tx_mode);
+ dsps_writel(mbase, wrp->rx_mode, glue->context.rx_mode);
+
+ musb_port_reset(musb, false);
+
+ return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(dsps_pm_ops, dsps_suspend, dsps_resume);
+
static struct platform_driver dsps_usbss_driver = {
.probe = dsps_probe,
.remove = dsps_remove,
.driver = {
.name = "musb-dsps",
+ .pm = &dsps_pm_ops,
.of_match_table = musb_dsps_of_match,
},
};
diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h
index e660af9..7436c24 100644
--- a/drivers/usb/musb/musb_host.h
+++ b/drivers/usb/musb/musb_host.h
@@ -93,6 +93,7 @@ extern void musb_root_disconnect(struct musb *musb);
extern void musb_host_resume_root_hub(struct musb *musb);
extern void musb_host_poke_root_hub(struct musb *musb);
extern void musb_port_suspend(struct musb *musb, bool do_suspend);
+extern void musb_port_reset(struct musb *musb, bool do_reset);
#else
static inline struct musb *hcd_to_musb(struct usb_hcd *hcd)
{
@@ -123,6 +124,7 @@ static inline void musb_host_resume_root_hub(struct musb *musb) {}
static inline void musb_host_poll_rh_status(struct musb *musb) {}
static inline void musb_host_poke_root_hub(struct musb *musb) {}
static inline void musb_port_suspend(struct musb *musb, bool do_suspend) {}
+static inline void musb_port_reset(struct musb *musb) {}
#endif
struct usb_hcd;
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
index e977441..24e46c0 100644
--- a/drivers/usb/musb/musb_virthub.c
+++ b/drivers/usb/musb/musb_virthub.c
@@ -109,7 +109,7 @@ void musb_port_suspend(struct musb *musb, bool do_suspend)
}
}
-static void musb_port_reset(struct musb *musb, bool do_reset)
+void musb_port_reset(struct musb *musb, bool do_reset)
{
u8 power;
void __iomem *mbase = musb->mregs;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 5/5] usb: musb: dsps: indentation and whitespace fixes
[not found] ` <1382089175-13487-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-10-18 9:39 ` Daniel Mack
2013-10-18 9:59 ` [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume Sebastian Andrzej Siewior
1 sibling, 0 replies; 12+ messages in thread
From: Daniel Mack @ 2013-10-18 9:39 UTC (permalink / raw)
To: linux-usb-u79uwXL29TY76Z2rM5mHXA
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, neumann-SRDuVqtxQLSzQB+pC5nmwQ,
bigeasy-hfZtesqFncYOwBW4kG4KsQ, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w, balbi-l0cyMroinI0,
Daniel Mack
Just a cosmetic thing, no functional change.
Signed-off-by: Daniel Mack <zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/usb/musb/musb_dsps.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index ce5bbc6..0fa3468 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -131,9 +131,9 @@ struct dsps_context {
struct dsps_glue {
struct device *dev;
struct platform_device *musb; /* child musb pdev */
- const struct dsps_musb_wrapper *wrp; /* wrapper register offsets */
+ const struct dsps_musb_wrapper *wrp; /* wrapper register offsets */
struct timer_list timer; /* otg_workaround timer */
- unsigned long last_timer; /* last timer data for each instance */
+ unsigned long last_timer; /* last timer data for each instance */
struct dsps_context context;
};
@@ -213,7 +213,7 @@ static void dsps_musb_disable(struct musb *musb)
dsps_writel(reg_base, wrp->coreintr_clear, wrp->usb_bitmap);
dsps_writel(reg_base, wrp->epintr_clear,
- wrp->txep_bitmap | wrp->rxep_bitmap);
+ wrp->txep_bitmap | wrp->rxep_bitmap);
dsps_writeb(musb->mregs, MUSB_DEVCTL, 0);
}
@@ -234,7 +234,7 @@ static void otg_timer(unsigned long _musb)
*/
devctl = dsps_readb(mregs, MUSB_DEVCTL);
dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
- usb_otg_state_string(musb->xceiv->state));
+ usb_otg_state_string(musb->xceiv->state));
spin_lock_irqsave(&musb->lock, flags);
switch (musb->xceiv->state) {
@@ -298,7 +298,7 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
dsps_writel(reg_base, wrp->coreintr_status, usbintr);
dev_dbg(musb->controller, "usbintr (%x) epintr(%x)\n",
- usbintr, epintr);
+ usbintr, epintr);
/*
* DRVVBUS IRQs are the only proxy we have (a very poor one!) for
* DSPS IP's missing ID change IRQ. We need an ID change IRQ to
@@ -348,10 +348,9 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
/* NOTE: this must complete power-on within 100 ms. */
dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
- drvvbus ? "on" : "off",
- usb_otg_state_string(musb->xceiv->state),
- err ? " ERROR" : "",
- devctl);
+ drvvbus ? "on" : "off",
+ usb_otg_state_string(musb->xceiv->state),
+ err ? " ERROR" : "", devctl);
ret = IRQ_HANDLED;
}
@@ -692,9 +691,9 @@ static SIMPLE_DEV_PM_OPS(dsps_pm_ops, dsps_suspend, dsps_resume);
static struct platform_driver dsps_usbss_driver = {
.probe = dsps_probe,
- .remove = dsps_remove,
- .driver = {
- .name = "musb-dsps",
+ .remove = dsps_remove,
+ .driver = {
+ .name = "musb-dsps",
.pm = &dsps_pm_ops,
.of_match_table = musb_dsps_of_match,
},
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 4/5] usb: musb: dsps: add support for suspend and resume
2013-10-18 9:39 ` [PATCH v3 4/5] usb: musb: dsps: add support for suspend and resume Daniel Mack
@ 2013-10-18 9:58 ` Sebastian Andrzej Siewior
[not found] ` <52610643.1000607-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-18 9:58 UTC (permalink / raw)
To: Daniel Mack
Cc: linux-usb, linux-omap, neumann, vinod.koul, dan.j.williams, balbi
On 10/18/2013 11:39 AM, Daniel Mack wrote:
> diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
> index da21a4e..ce5bbc6 100644
> --- a/drivers/usb/musb/musb_dsps.c
> +++ b/drivers/usb/musb/musb_dsps.c
> @@ -632,11 +648,54 @@ static const struct of_device_id musb_dsps_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, musb_dsps_of_match);
>
> +#ifdef CONFIG_PM
> +static int dsps_suspend(struct device *dev)
> +{
> + struct dsps_glue *glue = dev_get_drvdata(dev);
> + const struct dsps_musb_wrapper *wrp = glue->wrp;
> + struct musb *musb = platform_get_drvdata(glue->musb);
> + void __iomem *mbase = musb->ctrl_base;
> +
> + glue->context.control = dsps_readl(mbase, wrp->control);
> + glue->context.epintr = dsps_readl(mbase, wrp->epintr_set);
> + glue->context.coreintr = dsps_readl(mbase, wrp->coreintr_set);
> + glue->context.phy_utmi = dsps_readl(mbase, wrp->phy_utmi);
> + glue->context.mode = dsps_readl(mbase, wrp->mode);
> + glue->context.tx_mode = dsps_readl(mbase, wrp->tx_mode);
> + glue->context.rx_mode = dsps_readl(mbase, wrp->rx_mode);
Looking at this made me wonder, what about
drivers/usb/phy/phy-am335x-control.c
Since it seems to work for you, maybe we don't need this after all :P
Sebastian
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume
[not found] ` <1382089175-13487-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-18 9:39 ` [PATCH v3 5/5] usb: musb: dsps: indentation and whitespace fixes Daniel Mack
@ 2013-10-18 9:59 ` Sebastian Andrzej Siewior
[not found] ` <52610696.7020900-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
1 sibling, 1 reply; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-18 9:59 UTC (permalink / raw)
To: Daniel Mack
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA, neumann-SRDuVqtxQLSzQB+pC5nmwQ,
vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w, balbi-l0cyMroinI0
On 10/18/2013 11:39 AM, Daniel Mack wrote:
> v3 of my musb_dsps suspend patches.
>
> With these patches applied, I can successfully bring an AM335x board
> to suspend with a USB media connected, and access it again after
> resume.
>
> This works for both PIO mode and CPPI41 enabled configurations,
> together with Sebasitian's and my cppi41 patches recently posted.
>
> Felipe, this work was rebased and now applies cleanly on top of
> your current 'next' branch. IOW, on top of "usb: musb: cppi41: allow
> to defer probing if DMA isn't yet available".
Sounds good. What happend to the patch series where you used a
workqueue do defer some sleeping code that caused "sleeping while
atomic" warnings?
>
> Thanks,
> Daniel
>
Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 4/5] usb: musb: dsps: add support for suspend and resume
[not found] ` <52610643.1000607-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
@ 2013-10-18 10:00 ` Daniel Mack
0 siblings, 0 replies; 12+ messages in thread
From: Daniel Mack @ 2013-10-18 10:00 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA, neumann-SRDuVqtxQLSzQB+pC5nmwQ,
vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w, balbi-l0cyMroinI0
On 10/18/2013 11:58 AM, Sebastian Andrzej Siewior wrote:
> On 10/18/2013 11:39 AM, Daniel Mack wrote:
>
>> diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
>> index da21a4e..ce5bbc6 100644
>> --- a/drivers/usb/musb/musb_dsps.c
>> +++ b/drivers/usb/musb/musb_dsps.c
>> @@ -632,11 +648,54 @@ static const struct of_device_id musb_dsps_of_match[] = {
>> };
>> MODULE_DEVICE_TABLE(of, musb_dsps_of_match);
>>
>> +#ifdef CONFIG_PM
>> +static int dsps_suspend(struct device *dev)
>> +{
>> + struct dsps_glue *glue = dev_get_drvdata(dev);
>> + const struct dsps_musb_wrapper *wrp = glue->wrp;
>> + struct musb *musb = platform_get_drvdata(glue->musb);
>> + void __iomem *mbase = musb->ctrl_base;
>> +
>> + glue->context.control = dsps_readl(mbase, wrp->control);
>> + glue->context.epintr = dsps_readl(mbase, wrp->epintr_set);
>> + glue->context.coreintr = dsps_readl(mbase, wrp->coreintr_set);
>> + glue->context.phy_utmi = dsps_readl(mbase, wrp->phy_utmi);
>> + glue->context.mode = dsps_readl(mbase, wrp->mode);
>> + glue->context.tx_mode = dsps_readl(mbase, wrp->tx_mode);
>> + glue->context.rx_mode = dsps_readl(mbase, wrp->rx_mode);
>
> Looking at this made me wonder, what about
>
> drivers/usb/phy/phy-am335x-control.c
>
> Since it seems to work for you, maybe we don't need this after all :P
Yes, I thought that needs fixing as well, but at least on my system, it
doesn't. So I skipped that for now.
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume
[not found] ` <52610696.7020900-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
@ 2013-10-18 10:02 ` Daniel Mack
2013-10-18 10:05 ` Sebastian Andrzej Siewior
2013-10-28 11:06 ` Daniel Mack
1 sibling, 1 reply; 12+ messages in thread
From: Daniel Mack @ 2013-10-18 10:02 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA, neumann-SRDuVqtxQLSzQB+pC5nmwQ,
vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w, balbi-l0cyMroinI0
On 10/18/2013 11:59 AM, Sebastian Andrzej Siewior wrote:
> On 10/18/2013 11:39 AM, Daniel Mack wrote:
>> v3 of my musb_dsps suspend patches.
>>
>> With these patches applied, I can successfully bring an AM335x board
>> to suspend with a USB media connected, and access it again after
>> resume.
>>
>> This works for both PIO mode and CPPI41 enabled configurations,
>> together with Sebasitian's and my cppi41 patches recently posted.
>>
>> Felipe, this work was rebased and now applies cleanly on top of
>> your current 'next' branch. IOW, on top of "usb: musb: cppi41: allow
>> to defer probing if DMA isn't yet available".
>
> Sounds good. What happend to the patch series where you used a
> workqueue do defer some sleeping code that caused "sleeping while
> atomic" warnings?
As mentioned, that doesn't hit me anymore with the current patch stack.
That doesn't mean we should ignore that issue, of course, we're still
sleeping while atomic. But I removed the patch from the series for now,
so we can address that separately.
Thanks,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume
2013-10-18 10:02 ` Daniel Mack
@ 2013-10-18 10:05 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 12+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-18 10:05 UTC (permalink / raw)
To: Daniel Mack
Cc: linux-usb, linux-omap, neumann, vinod.koul, dan.j.williams, balbi
On 10/18/2013 12:02 PM, Daniel Mack wrote:
> As mentioned, that doesn't hit me anymore with the current patch stack.
>
> That doesn't mean we should ignore that issue, of course, we're still
> sleeping while atomic. But I removed the patch from the series for now,
> so we can address that separately.
Ach okay, I though you found a different solution.
>
> Thanks,
> Daniel
Sebastian
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume
[not found] ` <52610696.7020900-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-10-18 10:02 ` Daniel Mack
@ 2013-10-28 11:06 ` Daniel Mack
1 sibling, 0 replies; 12+ messages in thread
From: Daniel Mack @ 2013-10-28 11:06 UTC (permalink / raw)
To: Sebastian Andrzej Siewior, balbi-l0cyMroinI0
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA, neumann-SRDuVqtxQLSzQB+pC5nmwQ,
vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w
On 10/18/2013 11:59 AM, Sebastian Andrzej Siewior wrote:
> On 10/18/2013 11:39 AM, Daniel Mack wrote:
>> v3 of my musb_dsps suspend patches.
>>
>> With these patches applied, I can successfully bring an AM335x board
>> to suspend with a USB media connected, and access it again after
>> resume.
>>
>> This works for both PIO mode and CPPI41 enabled configurations,
>> together with Sebasitian's and my cppi41 patches recently posted.
>>
>> Felipe, this work was rebased and now applies cleanly on top of
>> your current 'next' branch. IOW, on top of "usb: musb: cppi41: allow
>> to defer probing if DMA isn't yet available".
>
> Sounds good.
Felipe, do you think that series is good to be taken for 3.13?
Thanks,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2013-10-28 11:06 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-18 9:39 [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume Daniel Mack
2013-10-18 9:39 ` [PATCH v3 1/5] usb: musb: call musb_port_suspend from musb_bus_suspend Daniel Mack
2013-10-18 9:39 ` [PATCH v3 2/5] usb: musb: conditionally save and restore the context on suspend Daniel Mack
2013-10-18 9:39 ` [PATCH v3 3/5] usb: musb: dsps: add {tx,rx}_mode to wrapper Daniel Mack
2013-10-18 9:39 ` [PATCH v3 4/5] usb: musb: dsps: add support for suspend and resume Daniel Mack
2013-10-18 9:58 ` Sebastian Andrzej Siewior
[not found] ` <52610643.1000607-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-10-18 10:00 ` Daniel Mack
[not found] ` <1382089175-13487-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-18 9:39 ` [PATCH v3 5/5] usb: musb: dsps: indentation and whitespace fixes Daniel Mack
2013-10-18 9:59 ` [PATCH v3 0/5] usb: musb_dsps: support for suspend and resume Sebastian Andrzej Siewior
[not found] ` <52610696.7020900-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-10-18 10:02 ` Daniel Mack
2013-10-18 10:05 ` Sebastian Andrzej Siewior
2013-10-28 11:06 ` Daniel Mack
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).