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

Fabio Estevam festevam at gmail.com
Sun Jun 10 14:41:19 EDT 2012


Hi Christoph,

On Mon, Jun 4, 2012 at 8:37 AM, Christoph Fritz
<chf.fritz at 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(-)

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);
 	}
 }
--



More information about the linux-arm-kernel mailing list