All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Munegowda, Keshava" <keshava_mgowda-l0cyMroinI0@public.gmane.org>
To: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	khilman-l0cyMroinI0@public.gmane.org
Cc: Keshava Munegowda <keshava_mgowda-l0cyMroinI0@public.gmane.org>,
	balbi-l0cyMroinI0@public.gmane.org,
	sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH] OMAP: USB : Fix the EHCI enumeration and core retention issue
Date: Thu, 21 Jun 2012 19:13:52 +0530	[thread overview]
Message-ID: <CAP05o4KOprVvgJ5aLD2+LLARtspRFkoE0Rob-dtVC7CefO-W2A@mail.gmail.com> (raw)
In-Reply-To: <1340286132-20634-1-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>

On Thu, Jun 21, 2012 at 7:12 PM, Keshava Munegowda
<keshava_mgowda-l0cyMroinI0@public.gmane.org> wrote:
> This commit 354ab8567ae3107a8cbe7228c3181990ba598aac titled
> "Fix OMAP EHCI suspend/resume failure (i693)" is causing
> the usb hub and device detection fails in beagle XM
> causeing NFS not functional. This affects the core retention too.
> The same commit logic needs to be revisted adhering to hwmod and
> device tree framework.
> for now, this commit id 354ab8567ae3107a8cbe7228c3181990ba598aac
> titled "Fix OMAP EHCI suspend/resume failure (i693)" reverted.
>
> This patch is validated on BeagleXM with NFS support over
> usb ethernet and USB mass storage and other device detection.
>
> Signed-off-by: Keshava Munegowda <keshava_mgowda-l0cyMroinI0@public.gmane.org>
> ---
>  drivers/usb/host/ehci-omap.c |  164 +-----------------------------------------
>  1 file changed, 1 insertion(+), 163 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index 17cfb8a..272e661 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -56,15 +56,6 @@
>  #define        EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT             8
>  #define        EHCI_INSNREG05_ULPI_WRDATA_SHIFT                0
>
> -/* Errata i693 */
> -static struct clk      *utmi_p1_fck;
> -static struct clk      *utmi_p2_fck;
> -static struct clk      *xclk60mhsp1_ck;
> -static struct clk      *xclk60mhsp2_ck;
> -static struct clk      *usbhost_p1_fck;
> -static struct clk      *usbhost_p2_fck;
> -static struct clk      *init_60m_fclk;
> -
>  /*-------------------------------------------------------------------------*/
>
>  static const struct hc_driver ehci_omap_hc_driver;
> @@ -80,40 +71,6 @@ static inline u32 ehci_read(void __iomem *base, u32 reg)
>        return __raw_readl(base + reg);
>  }
>
> -/* Erratum i693 workaround sequence */
> -static void omap_ehci_erratum_i693(struct ehci_hcd *ehci)
> -{
> -       int ret = 0;
> -
> -       /* Switch to the internal 60 MHz clock */
> -       ret = clk_set_parent(utmi_p1_fck, init_60m_fclk);
> -       if (ret != 0)
> -               ehci_err(ehci, "init_60m_fclk set parent"
> -                       "failed error:%d\n", ret);
> -
> -       ret = clk_set_parent(utmi_p2_fck, init_60m_fclk);
> -       if (ret != 0)
> -               ehci_err(ehci, "init_60m_fclk set parent"
> -                       "failed error:%d\n", ret);
> -
> -       clk_enable(usbhost_p1_fck);
> -       clk_enable(usbhost_p2_fck);
> -
> -       /* Wait 1ms and switch back to the external clock */
> -       mdelay(1);
> -       ret = clk_set_parent(utmi_p1_fck, xclk60mhsp1_ck);
> -       if (ret != 0)
> -               ehci_err(ehci, "xclk60mhsp1_ck set parent"
> -                       "failed error:%d\n", ret);
> -
> -       ret = clk_set_parent(utmi_p2_fck, xclk60mhsp2_ck);
> -       if (ret != 0)
> -               ehci_err(ehci, "xclk60mhsp2_ck set parent"
> -                       "failed error:%d\n", ret);
> -
> -       clk_disable(usbhost_p1_fck);
> -       clk_disable(usbhost_p2_fck);
> -}
>
>  static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port)
>  {
> @@ -145,50 +102,6 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port)
>        }
>  }
>
> -static int omap_ehci_hub_control(
> -       struct usb_hcd  *hcd,
> -       u16             typeReq,
> -       u16             wValue,
> -       u16             wIndex,
> -       char            *buf,
> -       u16             wLength
> -)
> -{
> -       struct ehci_hcd *ehci = hcd_to_ehci(hcd);
> -       u32 __iomem *status_reg = &ehci->regs->port_status[
> -                               (wIndex & 0xff) - 1];
> -       u32             temp;
> -       unsigned long   flags;
> -       int             retval = 0;
> -
> -       spin_lock_irqsave(&ehci->lock, flags);
> -
> -       if (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_SUSPEND) {
> -               temp = ehci_readl(ehci, status_reg);
> -               if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) != 0) {
> -                       retval = -EPIPE;
> -                       goto done;
> -               }
> -
> -               temp &= ~PORT_WKCONN_E;
> -               temp |= PORT_WKDISC_E | PORT_WKOC_E;
> -               ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
> -
> -               omap_ehci_erratum_i693(ehci);
> -
> -               set_bit((wIndex & 0xff) - 1, &ehci->suspended_ports);
> -               goto done;
> -       }
> -
> -       spin_unlock_irqrestore(&ehci->lock, flags);
> -
> -       /* Handle the hub control events here */
> -       return ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength);
> -done:
> -       spin_unlock_irqrestore(&ehci->lock, flags);
> -       return retval;
> -}
> -
>  static void disable_put_regulator(
>                struct ehci_hcd_omap_platform_data *pdata)
>  {
> @@ -353,76 +266,9 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>        /* root ports should always stay powered */
>        ehci_port_power(omap_ehci, 1);
>
> -       /* get clocks */
> -       utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk");
> -       if (IS_ERR(utmi_p1_fck)) {
> -               ret = PTR_ERR(utmi_p1_fck);
> -               dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret);
> -               goto err_add_hcd;
> -       }
> -
> -       xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck");
> -       if (IS_ERR(xclk60mhsp1_ck)) {
> -               ret = PTR_ERR(xclk60mhsp1_ck);
> -               dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
> -               goto err_utmi_p1_fck;
> -       }
> -
> -       utmi_p2_fck = clk_get(dev, "utmi_p2_gfclk");
> -       if (IS_ERR(utmi_p2_fck)) {
> -               ret = PTR_ERR(utmi_p2_fck);
> -               dev_err(dev, "utmi_p2_gfclk failed error:%d\n", ret);
> -               goto err_xclk60mhsp1_ck;
> -       }
> -
> -       xclk60mhsp2_ck = clk_get(dev, "xclk60mhsp2_ck");
> -       if (IS_ERR(xclk60mhsp2_ck)) {
> -               ret = PTR_ERR(xclk60mhsp2_ck);
> -               dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret);
> -               goto err_utmi_p2_fck;
> -       }
> -
> -       usbhost_p1_fck = clk_get(dev, "usb_host_hs_utmi_p1_clk");
> -       if (IS_ERR(usbhost_p1_fck)) {
> -               ret = PTR_ERR(usbhost_p1_fck);
> -               dev_err(dev, "usbhost_p1_fck failed error:%d\n", ret);
> -               goto err_xclk60mhsp2_ck;
> -       }
> -
> -       usbhost_p2_fck = clk_get(dev, "usb_host_hs_utmi_p2_clk");
> -       if (IS_ERR(usbhost_p2_fck)) {
> -               ret = PTR_ERR(usbhost_p2_fck);
> -               dev_err(dev, "usbhost_p2_fck failed error:%d\n", ret);
> -               goto err_usbhost_p1_fck;
> -       }
> -
> -       init_60m_fclk = clk_get(dev, "init_60m_fclk");
> -       if (IS_ERR(init_60m_fclk)) {
> -               ret = PTR_ERR(init_60m_fclk);
> -               dev_err(dev, "init_60m_fclk failed error:%d\n", ret);
> -               goto err_usbhost_p2_fck;
> -       }
>
>        return 0;
>
> -err_usbhost_p2_fck:
> -       clk_put(usbhost_p2_fck);
> -
> -err_usbhost_p1_fck:
> -       clk_put(usbhost_p1_fck);
> -
> -err_xclk60mhsp2_ck:
> -       clk_put(xclk60mhsp2_ck);
> -
> -err_utmi_p2_fck:
> -       clk_put(utmi_p2_fck);
> -
> -err_xclk60mhsp1_ck:
> -       clk_put(xclk60mhsp1_ck);
> -
> -err_utmi_p1_fck:
> -       clk_put(utmi_p1_fck);
> -
>  err_add_hcd:
>        disable_put_regulator(pdata);
>        pm_runtime_put_sync(dev);
> @@ -452,14 +298,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
>        iounmap(hcd->regs);
>        usb_put_hcd(hcd);
>
> -       clk_put(utmi_p1_fck);
> -       clk_put(utmi_p2_fck);
> -       clk_put(xclk60mhsp1_ck);
> -       clk_put(xclk60mhsp2_ck);
> -       clk_put(usbhost_p1_fck);
> -       clk_put(usbhost_p2_fck);
> -       clk_put(init_60m_fclk);
> -
>        pm_runtime_put_sync(dev);
>        pm_runtime_disable(dev);
>
> @@ -530,7 +368,7 @@ static const struct hc_driver ehci_omap_hc_driver = {
>         * root hub support
>         */
>        .hub_status_data        = ehci_hub_status_data,
> -       .hub_control            = omap_ehci_hub_control,
> +       .hub_control            = ehci_hub_control,
>        .bus_suspend            = ehci_bus_suspend,
>        .bus_resume             = ehci_bus_resume,
>
> --
> 1.7.9.5
>

hi kevin

here is pm count log on beagle XM with the above patch:

 cat ./debug/pm_debug/count
usbhost_pwrdm (ON),OFF:0,RET:3,INA:0,ON:4,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0
sgx_pwrdm (OFF),OFF:1,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0
core_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0
per_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0
dss_pwrdm (ON),OFF:0,RET:1254,INA:0,ON:1255,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0
cam_pwrdm (RET),OFF:0,RET:1,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0
neon_pwrdm (ON),OFF:0,RET:1254,INA:0,ON:1255,RET-LOGIC-OFF:0
mpu_pwrdm (ON),OFF:0,RET:1254,INA:0,ON:1255,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0
iva2_pwrdm (RET),OFF:0,RET:1,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0,RET-MEMBANK3-OFF:0,RET-MEMBANK4-OFF:0
usbhost_clkdm->usbhost_pwrdm (3)
sgx_clkdm->sgx_pwrdm (0)
per_clkdm->per_pwrdm (19)
cam_clkdm->cam_pwrdm (0)
dss_clkdm->dss_pwrdm (1)
core_l4_clkdm->core_pwrdm (25)
core_l3_clkdm->core_pwrdm (4)
d2d_clkdm->core_pwrdm (0)
iva2_clkdm->iva2_pwrdm (0)
neon_clkdm->neon_pwrdm (0)
mpu_clkdm->mpu_pwrdm (0)
prm_clkdm->wkup_pwrdm (0)
cm_clkdm->core_pwrdm (0)


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

  parent reply	other threads:[~2012-06-21 13:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-21 13:42 [PATCH] OMAP: USB : Fix the EHCI enumeration and core retention issue Keshava Munegowda
     [not found] ` <1340286132-20634-1-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2012-06-21 13:43   ` Munegowda, Keshava [this message]
2012-06-21 19:02     ` Kevin Hilman
     [not found]       ` <87fw9o32v2.fsf-l0cyMroinI0@public.gmane.org>
2012-06-22  7:30         ` Munegowda, Keshava
     [not found]           ` <CAP05o4KxWFjCCP05KzQgo4vWLdvOCeT=DWGXvEEnyWkomH1tXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-22 10:30             ` Felipe Balbi
     [not found]               ` <20120622103050.GG28472-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-06-22 14:14                 ` Kevin Hilman
2012-06-22 15:03                   ` Russ Dill
     [not found]                     ` <CA+Bv8XY-_x+Vh+D8sec5tvL9MkOYFKnts1WBp_AsCck2y6QNZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-22 15:11                       ` Munegowda, Keshava
     [not found]                   ` <87ehp71liv.fsf-l0cyMroinI0@public.gmane.org>
2012-06-22 20:36                     ` Felipe Balbi
2012-06-25 18:35                       ` Kevin Hilman
     [not found]                         ` <87d34nfdei.fsf-l0cyMroinI0@public.gmane.org>
2012-07-02 16:54                           ` Kevin Hilman
     [not found]                             ` <871uku85o8.fsf-l0cyMroinI0@public.gmane.org>
2012-07-02 17:05                               ` Russ Dill
     [not found]                                 ` <CA+Bv8XaC64NChdcinrxagRYLZyTG7c05nDYy2EbfH-gfZUxnuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-02 17:55                                   ` Kevin Hilman
2012-07-02 18:15                                     ` Samuel Ortiz
2012-07-03  0:14                               ` Kevin Hilman
2012-07-03  6:45                                 ` Munegowda, Keshava
2012-07-03  6:47                               ` Munegowda, Keshava
     [not found]                                 ` <CAP05o4+hxt6zY0AxK5aNW7a3Hyiw0_krP9=XK_prN5=Uk2SxmA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-03  7:22                                   ` Munegowda, Keshava
2012-07-04 13:33                                     ` Kevin Hilman
2012-07-05 11:19                                       ` Samuel Ortiz
2012-07-06 10:00                                         ` Munegowda, Keshava
     [not found]                                           ` <CAP05o4JEx0uSCH+mZzLhoV479A00uUumvYY_-b8dQ9j_5Awumw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-06 11:59                                             ` Munegowda, Keshava
2012-07-11 10:29                                               ` Samuel Ortiz
2012-07-11 12:53                                                 ` Munegowda, Keshava
2012-07-11 14:23                                                   ` Kevin Hilman
     [not found]                                                     ` <874npenzq0.fsf-l0cyMroinI0@public.gmane.org>
2012-07-12  6:41                                                       ` Munegowda, Keshava
     [not found]                                                         ` <CAP05o4+hQh-weQ_hfFMxY-byEijwDF3e-D9U5gwh6yRD7C_=Zw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-19 10:17                                                           ` Munegowda, Keshava
2012-06-22 14:11             ` Kevin Hilman
2012-06-22 14:35               ` Alan Stern
     [not found]               ` <87vcij1loh.fsf-l0cyMroinI0@public.gmane.org>
2012-06-22 14:43                 ` Munegowda, Keshava
2012-06-22 18:49                   ` Kevin Hilman
2012-07-23  8:33                   ` Roger Quadros
     [not found]                     ` <500D0C42.8030508-l0cyMroinI0@public.gmane.org>
2012-07-23 11:27                       ` Munegowda, Keshava
2012-07-19 10:20 ` Felipe Balbi
     [not found]   ` <20120719102013.GJ14302-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-07-19 12:02     ` Munegowda, Keshava
2012-07-19 22:54     ` Greg KH
     [not found]       ` <20120719225405.GB32547-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-07-19 22:55         ` Greg KH
     [not found]           ` <20120719225523.GC32547-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-07-20  8:06             ` Munegowda, Keshava
2012-07-19 15:15   ` Alan Stern

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=CAP05o4KOprVvgJ5aLD2+LLARtspRFkoE0Rob-dtVC7CefO-W2A@mail.gmail.com \
    --to=keshava_mgowda-l0cymroini0@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=khilman-l0cyMroinI0@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=sameo-VuQAYsv1563Yd54FQh9/CA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.