From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>
Cc: Felipe Balbi <balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
George Cherian <george.cherian-l0cyMroinI0@public.gmane.org>,
Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
Ivaylo Dimitrov
<ivo.g.dimitrov.75-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Sergei Shtylyov
<sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 09/15] usb: musb: Remove try_idle for 2430 glue layer
Date: Wed, 11 May 2016 17:53:10 -0700 [thread overview]
Message-ID: <1463014396-4095-10-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1463014396-4095-1-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
This is no longer needed with PM runtime at least for 2430 glue.
We can now rely only on PM runtime and cable detection.
The other glue layers can probably remove try_idle too, but that
needs to be tested for each platform before doing it.
Signed-off-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
---
drivers/usb/musb/omap2430.c | 91 ---------------------------------------------
1 file changed, 91 deletions(-)
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index eb0f332..79e4cd7 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -57,92 +57,6 @@ struct omap2430_glue {
static struct omap2430_glue *_glue;
-static struct timer_list musb_idle_timer;
-
-static void musb_do_idle(unsigned long _musb)
-{
- struct musb *musb = (void *)_musb;
- unsigned long flags;
- u8 power;
- u8 devctl;
-
- spin_lock_irqsave(&musb->lock, flags);
-
- switch (musb->xceiv->otg->state) {
- case OTG_STATE_A_WAIT_BCON:
-
- devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
- if (devctl & MUSB_DEVCTL_BDEVICE) {
- musb->xceiv->otg->state = OTG_STATE_B_IDLE;
- MUSB_DEV_MODE(musb);
- } else {
- musb->xceiv->otg->state = OTG_STATE_A_IDLE;
- MUSB_HST_MODE(musb);
- }
- break;
- case OTG_STATE_A_SUSPEND:
- /* finish RESUME signaling? */
- if (musb->port1_status & MUSB_PORT_STAT_RESUME) {
- power = musb_readb(musb->mregs, MUSB_POWER);
- power &= ~MUSB_POWER_RESUME;
- dev_dbg(musb->controller, "root port resume stopped, power %02x\n", power);
- musb_writeb(musb->mregs, MUSB_POWER, power);
- musb->is_active = 1;
- musb->port1_status &= ~(USB_PORT_STAT_SUSPEND
- | MUSB_PORT_STAT_RESUME);
- musb->port1_status |= USB_PORT_STAT_C_SUSPEND << 16;
- usb_hcd_poll_rh_status(musb->hcd);
- /* NOTE: it might really be A_WAIT_BCON ... */
- musb->xceiv->otg->state = OTG_STATE_A_HOST;
- }
- break;
- case OTG_STATE_A_HOST:
- devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
- if (devctl & MUSB_DEVCTL_BDEVICE)
- musb->xceiv->otg->state = OTG_STATE_B_IDLE;
- else
- musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON;
- default:
- break;
- }
- spin_unlock_irqrestore(&musb->lock, flags);
-}
-
-
-static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout)
-{
- unsigned long default_timeout = jiffies + msecs_to_jiffies(3);
- static unsigned long last_timer;
-
- if (timeout == 0)
- timeout = default_timeout;
-
- /* Never idle if active, or when VBUS timeout is not set as host */
- if (musb->is_active || ((musb->a_wait_bcon == 0)
- && (musb->xceiv->otg->state == OTG_STATE_A_WAIT_BCON))) {
- dev_dbg(musb->controller, "%s active, deleting timer\n",
- usb_otg_state_string(musb->xceiv->otg->state));
- del_timer(&musb_idle_timer);
- last_timer = jiffies;
- return;
- }
-
- if (time_after(last_timer, timeout)) {
- if (!timer_pending(&musb_idle_timer))
- last_timer = timeout;
- else {
- dev_dbg(musb->controller, "Longer idle timer already pending, ignoring\n");
- return;
- }
- }
- last_timer = timeout;
-
- dev_dbg(musb->controller, "%s inactive, for idle timer for %lu ms\n",
- usb_otg_state_string(musb->xceiv->otg->state),
- (unsigned long)jiffies_to_msecs(timeout - jiffies));
- mod_timer(&musb_idle_timer, timeout);
-}
-
static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
{
struct usb_otg *otg = musb->xceiv->otg;
@@ -467,8 +381,6 @@ static int omap2430_musb_init(struct musb *musb)
musb_readl(musb->mregs, OTG_INTERFSEL),
musb_readl(musb->mregs, OTG_SIMENABLE));
- setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb);
-
if (glue->status != MUSB_UNKNOWN)
omap_musb_set_mailbox(glue);
@@ -543,7 +455,6 @@ static int omap2430_musb_exit(struct musb *musb)
struct device *dev = musb->controller;
struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
- del_timer_sync(&musb_idle_timer);
omap2430_low_level_exit(musb);
phy_exit(musb->phy);
musb->phy = NULL;
@@ -562,8 +473,6 @@ static const struct musb_platform_ops omap2430_ops = {
.exit = omap2430_musb_exit,
.set_mode = omap2430_musb_set_mode,
- .try_idle = omap2430_musb_try_idle,
next prev parent reply other threads:[~2016-05-12 0:53 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 0:53 [PATCHv2 00/15] Get MUSB PM runtime working again Tony Lindgren
[not found] ` <1463014396-4095-1-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-12 0:53 ` [PATCH 01/15] usb: musb: Fix idling after host mode by increasing autosuspend delay Tony Lindgren
2016-05-12 0:53 ` [PATCH 02/15] usb: musb: Remove unnecessary shutdown function Tony Lindgren
2016-05-12 0:53 ` [PATCH 03/15] usb: musb: Update to use PM runtime autosuspend Tony Lindgren
2016-05-12 0:53 ` [PATCH 04/15] usb: musb: Split PM runtime between wrapper IP and musb core Tony Lindgren
2016-05-12 0:53 ` [PATCH 05/15] usb: musb: Remove conditional PM runtime calls for musb_gadget Tony Lindgren
2016-05-12 0:53 ` [PATCH 06/15] usb: musb: Use delayed for musb_gadget_pullup Tony Lindgren
2016-05-12 0:53 ` [PATCH 07/15] usb: musb: Handle cable status better for 2430 glue layer Tony Lindgren
[not found] ` <1463014396-4095-8-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-12 1:33 ` Tony Lindgren
[not found] ` <20160512013303.GO5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-13 19:57 ` Bin Liu
2016-05-13 20:09 ` Tony Lindgren
[not found] ` <20160513200902.GB5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-13 20:21 ` Bin Liu
2016-05-13 20:24 ` Bin Liu
2016-05-13 20:33 ` Tony Lindgren
[not found] ` <20160513203330.GC5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-13 20:41 ` Bin Liu
2016-05-13 20:58 ` Tony Lindgren
2016-05-12 0:53 ` [PATCH 08/15] usb: musb: Improve PM runtime and phy handling " Tony Lindgren
[not found] ` <1463014396-4095-9-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-09 17:08 ` [08/15] " Laurent Pinchart
2016-09-09 17:24 ` Tony Lindgren
[not found] ` <20160909172447.kw3jb3odlpwt6egv-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-09 18:33 ` Laurent Pinchart
2016-09-09 19:24 ` Laurent Pinchart
2016-09-09 20:05 ` Tony Lindgren
2016-09-09 20:08 ` Tony Lindgren
2016-05-12 0:53 ` Tony Lindgren [this message]
2016-05-12 0:53 ` [PATCH 10/15] usb: musb: Don't set d+ high before enable " Tony Lindgren
[not found] ` <1463014396-4095-11-git-send-email-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-13 21:03 ` Bin Liu
2016-05-13 21:17 ` Tony Lindgren
[not found] ` <20160513211739.GE5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-13 21:22 ` Bin Liu
2016-05-13 21:39 ` Tony Lindgren
[not found] ` <20160513213900.GF5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-13 22:02 ` Bin Liu
2016-05-13 22:25 ` Tony Lindgren
[not found] ` <20160513222517.GG5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-15 4:42 ` Bin Liu
2016-05-16 15:19 ` Tony Lindgren
2016-05-13 22:35 ` Tony Lindgren
[not found] ` <20160513223540.GH5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-15 4:47 ` Bin Liu
2016-05-14 13:30 ` Sergei Shtylyov
[not found] ` <99ff5bff-e2f4-3137-2854-81d7b4b14bce-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-05-16 14:15 ` Bin Liu
2016-05-16 14:57 ` Tony Lindgren
[not found] ` <20160516145757.GI5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-16 15:22 ` Bin Liu
2016-05-16 15:45 ` Tony Lindgren
2016-05-12 0:53 ` [PATCH 11/15] usb: musb: Return error value from musb_mailbox Tony Lindgren
2016-05-12 0:53 ` [PATCH 12/15] usb: musb: Remove extra PM runtime calls from 2430 glue layer Tony Lindgren
2016-05-12 0:53 ` [PATCH 13/15] usb: musb: Remove pm_runtime_set_irq_safe Tony Lindgren
2016-05-12 0:53 ` [PATCH 14/15] usb: musb: Use normal module_init for 2430 glue Tony Lindgren
2016-05-12 0:53 ` [PATCH 15/15] usb: phy: Check initial state for twl6030 Tony Lindgren
2016-05-17 21:16 ` [PATCHv2 00/15] Get MUSB PM runtime working again Bin Liu
2016-05-17 21:54 ` Tony Lindgren
[not found] ` <20160517215403.GP5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-17 22:05 ` Bin Liu
2016-05-18 17:35 ` Bin Liu
2016-05-18 18:14 ` Tony Lindgren
[not found] ` <20160518181403.GR5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-18 18:45 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1605181442440.1981-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2016-05-18 19:12 ` Tony Lindgren
[not found] ` <20160518191239.GS5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-18 19:24 ` Bin Liu
2016-05-18 18:07 ` Tony Lindgren
[not found] ` <20160518180737.GQ5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-18 18:10 ` Bin Liu
2016-05-19 15:26 ` Tony Lindgren
[not found] ` <20160519152601.GV5995-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-05-19 17:50 ` Tony Lindgren
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=1463014396-4095-10-git-send-email-tony@atomide.com \
--to=tony-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
--cc=b-liu-l0cyMroinI0@public.gmane.org \
--cc=balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=george.cherian-l0cyMroinI0@public.gmane.org \
--cc=ivo.g.dimitrov.75-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kishon-l0cyMroinI0@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).