diff mbox

[v2] usb: fsl_udc: errata - postpone freeing current dTD

Message ID CAOMZO5B7+Qy06m7O=v1M3vt7to7ciKOhQOihVgAEf+utntvw4w@mail.gmail.com (mailing list archive)
State Awaiting Upstream, archived
Headers show

Commit Message

Fabio Estevam June 10, 2012, 6:41 p.m. UTC
Hi Christoph,

On Mon, Jun 4, 2012 at 8:37 AM, Christoph Fritz
<chf.fritz@googlemail.com> wrote:

> After that, I stumbled upon this dmesg:
>
> Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)
> fsl-usb2-udc fsl-usb2-udc: clk_get("usb") failed
> fsl-usb2-udc: probe of fsl-usb2-udc failed with error -2
>
> Sascha, could you give me a hint?

Does the patch below fix your problem?

 drivers/usb/gadget/fsl_mxc_udc.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

--

Comments

Christoph Fritz June 12, 2012, 7:40 p.m. UTC | #1
Hi Fabio

On Sun, 2012-06-10 at 15:41 -0300, Fabio Estevam wrote:
> Hi Christoph,
> 
> On Mon, Jun 4, 2012 at 8:37 AM, Christoph Fritz
> <chf.fritz@googlemail.com> wrote:
> 
> > After that, I stumbled upon this dmesg:
> >
> > Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)
> > fsl-usb2-udc fsl-usb2-udc: clk_get("usb") failed
> > fsl-usb2-udc: probe of fsl-usb2-udc failed with error -2
> >
> > Sascha, could you give me a hint?
> 
> Does the patch below fix your problem?

Thanks for your patch. It does indeed load
"Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)"
fine - but now when I want to use it:

modprobe g_ether
[   17.099363] g_ether gadget: using random self ethernet address
[   17.105316] g_ether gadget: using random host ethernet address
[   17.111974] usb0: MAC 1a:c7:9e:76:cc:45
[   17.115866] usb0: HOST MAC 66:a2:4a:0a:46:17
[   17.120199] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[   17.126861] g_ether gadget: g_ether ready

these are "the last words": System hangs completely. Same behavior with
g_serial (these two I've tested).

Currently I can't investigate this further, not because of a bug - but a
flu.


Thanks,
 -- Christoph
Fabio Estevam June 13, 2012, 1:17 a.m. UTC | #2
On Tue, Jun 12, 2012 at 4:40 PM, Christoph Fritz
<chf.fritz@googlemail.com> wrote:

> Thanks for your patch. It does indeed load
> "Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)"
> fine - but now when I want to use it:
>
> modprobe g_ether
> [   17.099363] g_ether gadget: using random self ethernet address
> [   17.105316] g_ether gadget: using random host ethernet address
> [   17.111974] usb0: MAC 1a:c7:9e:76:cc:45
> [   17.115866] usb0: HOST MAC 66:a2:4a:0a:46:17
> [   17.120199] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
> [   17.126861] g_ether gadget: g_ether ready
>
> these are "the last words": System hangs completely. Same behavior with
> g_serial (these two I've tested).

Ok, I just sent a new patch to the linux-usb mailing list.

Tested it on a mx31 and mx51 and it probed g_ether fine. I don't have
a mx35 handy.

>
> Currently I can't investigate this further, not because of a bug - but a
> flu.

Hope you get better soon.

Regards,

Fabio Estevam
diff mbox

Patch

diff --git a/drivers/usb/gadget/fsl_mxc_udc.c b/drivers/usb/gadget/fsl_mxc_udc.c
index dcbc0a2..c3ade6b 100644
--- a/drivers/usb/gadget/fsl_mxc_udc.c
+++ b/drivers/usb/gadget/fsl_mxc_udc.c
@@ -36,21 +36,21 @@  int fsl_udc_clk_init(struct platform_device *pdev)
 	pdata = pdev->dev.platform_data;

 	if (!cpu_is_mx35() && !cpu_is_mx25()) {
-		mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb");
+		mxc_ahb_clk = clk_get(&pdev->dev, "ipg");
 		if (IS_ERR(mxc_ahb_clk))
 			return PTR_ERR(mxc_ahb_clk);

-		ret = clk_enable(mxc_ahb_clk);
+		ret = clk_prepare_enable(mxc_ahb_clk);
 		if (ret < 0) {
-			dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n");
+			dev_err(&pdev->dev, "clk_enable(\"ipg\") failed\n");
 			goto eenahb;
 		}
 	}

 	/* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */
-	mxc_usb_clk = clk_get(&pdev->dev, "usb");
+	mxc_usb_clk = clk_get(&pdev->dev, "per");
 	if (IS_ERR(mxc_usb_clk)) {
-		dev_err(&pdev->dev, "clk_get(\"usb\") failed\n");
+		dev_err(&pdev->dev, "clk_get(\"per\") failed\n");
 		ret = PTR_ERR(mxc_usb_clk);
 		goto egusb;
 	}
@@ -65,7 +65,7 @@  int fsl_udc_clk_init(struct platform_device *pdev)
 		}
 	}

-	ret = clk_enable(mxc_usb_clk);
+	ret = clk_prepare_enable(mxc_usb_clk);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "clk_enable(\"usb_clk\") failed\n");
 		goto eenusb;
@@ -79,7 +79,7 @@  eclkrate:
 	mxc_usb_clk = NULL;
 egusb:
 	if (!cpu_is_mx35())
-		clk_disable(mxc_ahb_clk);
+		clk_disable_unprepare(mxc_ahb_clk);
 eenahb:
 	if (!cpu_is_mx35())
 		clk_put(mxc_ahb_clk);
@@ -104,7 +104,7 @@  void fsl_udc_clk_finalize(struct platform_device *pdev)

 	/* ULPI transceivers don't need usbpll */
 	if (pdata->phy_mode == FSL_USB2_PHY_ULPI) {
-		clk_disable(mxc_usb_clk);
+		clk_disable_unprepare(mxc_usb_clk);
 		clk_put(mxc_usb_clk);
 		mxc_usb_clk = NULL;
 	}
@@ -113,11 +113,11 @@  void fsl_udc_clk_finalize(struct platform_device *pdev)
 void fsl_udc_clk_release(void)
 {
 	if (mxc_usb_clk) {
-		clk_disable(mxc_usb_clk);
+		clk_disable_unprepare(mxc_usb_clk);
 		clk_put(mxc_usb_clk);
 	}
 	if (!cpu_is_mx35()) {
-		clk_disable(mxc_ahb_clk);
+		clk_disable_unprepare(mxc_ahb_clk);
 		clk_put(mxc_ahb_clk);
 	}
 }