Re: [PATCH 1/3] usb: phy: Add RCAR Gen2 USB phy
On 10/08/2013 07:27 AM, Kuninori Morimoto wrote: Hi Valentine Hi Morimoto-san, Thank you for your patch Thanks for looking at it. +/* Setup USB channels */ +static void __rcar_gen2_usb_phy_setup(struct rcar_gen2_usb_phy_priv *priv) +{ + u32 val; + + clk_prepare_enable(priv->clk); + + /* Set USB channels in the USBHS UGCTRL2 register */ + val = ioread32(priv->base); + val &= ~(USBHS_UGCTRL2_USB0_HS | USBHS_UGCTRL2_USB2_SS); + val |= priv->ugctrl2; + iowrite32(val, priv->base); +} From my point of view, if you use clk_enable() on setup(), then, it is easy to read if it has exit() or similar name function which calls clk_disable() Since in this case all is needed is to disable the clocks, I've decided not to put it in a separate exit function. I'll add one for better readability. +static int rcar_gen2_usb_phy_set_suspend(struct usb_phy *phy, int suspend) +{ + struct rcar_gen2_usb_phy_priv *priv = usb_phy_to_priv(phy); + unsigned long flags; + int retval; + + spin_lock_irqsave(&priv->lock, flags); + if (suspend) { + /* Suspend USBHS internal phy */ + retval = __rcar_gen2_usbhs_phy_disable(priv->base); + /* +* If nothing else is using USB channel 0/2 +* disable the clocks as well +*/ + if (priv->usecount == 1) { + clk_disable_unprepare(priv->clk); + priv->usecount--; + } + } else { + /* +* Enable the clock and setup USB channels +* if needed. +*/ + if (!priv->usecount) { + priv->usecount++; + __rcar_gen2_usb_phy_setup(priv); + } + /* Resume USBHS internal phy */ + retval = __rcar_gen2_usbhs_phy_enable(priv->base); + } Are these usecount++/usecount-- position correct ? The idea was to disable the clocks here if the phy is not used by other drivers (PCI USB host or USBSS), so that suspending the gadget would disable USBHS clocks. However, this needs phy enabled before the shutdown is called. I guess I'll drop the clock handling here and leave it solely to init/shutdown callbacks. +static int rcar_gen2_usb_phy_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct rcar_gen2_phy_platform_data *pdata; + struct rcar_gen2_usb_phy_priv *priv; + struct resource *res; + void __iomem *base; + struct clk *clk; + int retval; + + pdata = dev_get_platdata(&pdev->dev); + if (!pdata) { + dev_err(dev, "No platform data\n"); + return -EINVAL; + } + + clk = devm_clk_get(&pdev->dev, "usbhs"); + if (IS_ERR(clk)) { + dev_err(&pdev->dev, "Can't get the clock\n"); + return PTR_ERR(clk); + } This case (if you use usb_phy_rcar_gen2 driver), you can use pm_runtime_xxx instead of clk_get/enable/disable() Yes, I could. The reason I did not is that I'm not sure that a phy driver should use runtime PM, since it is actually mastered by other drivers which are supposed to control its power via init/shutdown and set_suspend callbacks. Thus, looks like the phy driver can't really auto-suspend and doesn't really support runtime PM. I think that handling clocks in the init/shutdown is a bit cleaner. It gives us more control over the phy power, where pm_runtime_xxx will do nothing if CONFIG_PM_RUNTIME is disabled. Thanks, Val. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] arm: shmobile: lager: Add USBHS support
On 10/08/2013 07:31 AM, Kuninori Morimoto wrote: Hi Valentine This adds USBHS PHY and registers USBHS device if the driver is enabled. Signed-off-by: Valentine Barshak --- (snip) +/* USBHS */ +#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC) +static const struct resource usbhs_resources[] __initconst = { + DEFINE_RES_MEM(0xe659, 0x100), + DEFINE_RES_IRQ(gic_spi(107)), +}; Why it needs #if IS_ENABLED() ? I guess nothing happen if renesas_usbhs driver registered without CONFIG_USB_RENESAS_USBHS_UDC. But am I misunderstanding ? Since USB channel 0 is shared between PCI USB host and USBHS we'll still need it later to properly configure the channel. Besides, is saves us some bits leaving all the unused callbacks and device structures out if we do not register the device when the driver is disabled. Thanks, Val. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] cdc-acm: put delayed_wb to list
From: xiao jin Date: Tue, 8 Oct 2013 16:57:29 +0800 Subject: [PATCH] cdc-acm: put delayed_wb to list If acm_write_start during acm suspend, write acm_wb is backuped to delayed_wb. When acm resume, the delayed_wb will be started. This mechanism can only record one write during acm suspend. More acm write will be abandoned. This patch is to use list_head to record the write acm_wb during acm suspend. It can ensure no acm write abandoned. Signed-off-by: xiao jin --- drivers/usb/class/cdc-acm.c | 30 -- drivers/usb/class/cdc-acm.h |7 ++- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 9f49bfe..be679be 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -607,6 +607,7 @@ static int acm_tty_write(struct tty_struct *tty, unsigned long flags; int wbn; struct acm_wb *wb; + struct delayed_wb *d_wb; if (!count) return 0; @@ -634,12 +635,17 @@ static int acm_tty_write(struct tty_struct *tty, usb_autopm_get_interface_async(acm->control); if (acm->susp_count) { - if (!acm->delayed_wb) - acm->delayed_wb = wb; - else + d_wb = kmalloc(sizeof(struct delayed_wb), GFP_ATOMIC); + if (d_wb == NULL) { usb_autopm_put_interface_async(acm->control); - spin_unlock_irqrestore(&acm->write_lock, flags); - return count; /* A white lie */ + spin_unlock_irqrestore(&acm->write_lock, flags); + return -ENOMEM; + } else { + d_wb->wb = wb; + list_add_tail(&d_wb->list, &acm->delayed_wb_list); + spin_unlock_irqrestore(&acm->write_lock, flags); + return count; /* A white lie */ + } } usb_mark_last_busy(acm->dev); @@ -1255,6 +1261,7 @@ made_compressed_probe: snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; snd->instance = acm; } + INIT_LIST_HEAD(&acm->delayed_wb_list); usb_set_intfdata(intf, acm); @@ -1449,6 +1456,7 @@ static int acm_resume(struct usb_interface *intf) { struct acm *acm = usb_get_intfdata(intf); struct acm_wb *wb; + struct delayed_wb *d_wb, *nd_wb; int rv = 0; int cnt; @@ -1464,14 +1472,16 @@ static int acm_resume(struct usb_interface *intf) rv = usb_submit_urb(acm->ctrlurb, GFP_NOIO); spin_lock_irq(&acm->write_lock); - if (acm->delayed_wb) { - wb = acm->delayed_wb; - acm->delayed_wb = NULL; + list_for_each_entry_safe(d_wb, nd_wb, + &acm->delayed_wb_list, list) { + wb = d_wb->wb; + list_del(&d_wb->list); + kfree(d_wb); spin_unlock_irq(&acm->write_lock); acm_start_wb(acm, wb); - } else { - spin_unlock_irq(&acm->write_lock); + spin_lock_irq(&acm->write_lock); } + spin_unlock_irq(&acm->write_lock); /* * delayed error checking because we must diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h index 0f76e4a..5eed93f 100644 --- a/drivers/usb/class/cdc-acm.h +++ b/drivers/usb/class/cdc-acm.h @@ -79,6 +79,11 @@ struct acm_rb { struct acm *instance; }; +struct delayed_wb { + struct list_headlist; + struct acm_wb *wb; +} + struct acm { struct usb_device *dev; /* the corresponding usb device */ struct usb_interface *control; /* control interface */ @@ -117,7 +122,7 @@ struct acm { unsigned int throttled:1; /* actually throttled */ unsigned int throttle_req:1;/* throttle requested */ u8 bInterval; - struct acm_wb *delayed_wb; /* write queued for a device about to be woken */ + struct list_head delayed_wb_list; /* delayed wb list */ }; #define CDC_DATA_INTERFACE_TYPE0x0a -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] arm: shmobile: lager: Add USBHS support
Hi Valentine > >> +/* USBHS */ > >> +#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC) > >> +static const struct resource usbhs_resources[] __initconst = { > >> + DEFINE_RES_MEM(0xe659, 0x100), > >> + DEFINE_RES_IRQ(gic_spi(107)), > >> +}; > > > > Why it needs #if IS_ENABLED() ? > > I guess nothing happen if renesas_usbhs driver > > registered without CONFIG_USB_RENESAS_USBHS_UDC. > > But am I misunderstanding ? > > > > Since USB channel 0 is shared between PCI USB host and USBHS > we'll still need it later to properly configure the channel. > Besides, is saves us some bits leaving all the unused callbacks and > device structures out if we do not register the device when the driver > is disabled. Ahh, I see. Sorry for my noise Best regards --- Kuninori Morimoto -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] usb: phy: Add RCAR Gen2 USB phy
Hi Valentine > > From my point of view, if you use clk_enable() on setup(), > > then, it is easy to read if it has exit() or similar name function > > which calls clk_disable() > > Since in this case all is needed is to disable the clocks, I've decided > not to put it in a separate exit function. I'll add one for better > readability. Thank you > > Are these usecount++/usecount-- position correct ? > > The idea was to disable the clocks here if the phy is not used by other > drivers (PCI USB host or USBSS), so that suspending the gadget would > disable USBHS clocks. However, this needs phy enabled before the > shutdown is called. I guess I'll drop the clock handling here and leave > it solely to init/shutdown callbacks. Thank you > >> + clk = devm_clk_get(&pdev->dev, "usbhs"); > >> + if (IS_ERR(clk)) { > >> + dev_err(&pdev->dev, "Can't get the clock\n"); > >> + return PTR_ERR(clk); > >> + } > > > > This case (if you use usb_phy_rcar_gen2 driver), > > you can use pm_runtime_xxx instead of clk_get/enable/disable() > > > > Yes, I could. The reason I did not is that I'm not sure that a phy > driver should use runtime PM, since it is actually mastered by other > drivers which are supposed to control its power via init/shutdown and > set_suspend callbacks. Thus, looks like the phy driver can't really > auto-suspend and doesn't really support runtime PM. > > I think that handling clocks in the init/shutdown is a bit cleaner. > It gives us more control over the phy power, where pm_runtime_xxx will > do nothing if CONFIG_PM_RUNTIME is disabled. OK, it is reasonable for me Best regards --- Kuninori Morimoto -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 5/6] Revert "ARM: OMAP2+: Provide alias to USB PHY clock"
This reverts commit 741532c4a995be11815cb72d4d7a48f442a22fea. The proper clock reference is provided in device tree so we no longer need this. Signed-off-by: Roger Quadros --- arch/arm/mach-omap2/board-generic.c | 23 +-- 1 files changed, 1 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index cd85b36..da4e9b2 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -15,7 +15,6 @@ #include #include #include -#include #include @@ -36,21 +35,6 @@ static struct of_device_id omap_dt_match_table[] __initdata = { { } }; -/* - * Create alias for USB host PHY clock. - * Remove this when clock phandle can be provided via DT - */ -static void __init legacy_init_ehci_clk(char *clkname) -{ - int ret; - - ret = clk_add_alias("main_clk", NULL, clkname, NULL); - if (ret) { - pr_err("%s:Failed to add main_clk alias to %s :%d\n", - __func__, clkname, ret); - } -} - static void __init omap_generic_init(void) { omap_sdrc_init(NULL, NULL); @@ -61,15 +45,10 @@ static void __init omap_generic_init(void) * HACK: call display setup code for selected boards to enable omapdss. * This will be removed when omapdss supports DT. */ - if (of_machine_is_compatible("ti,omap4-panda")) { + if (of_machine_is_compatible("ti,omap4-panda")) omap4_panda_display_init_of(); - legacy_init_ehci_clk("auxclk3_ck"); - - } else if (of_machine_is_compatible("ti,omap4-sdp")) omap_4430sdp_display_init_of(); - else if (of_machine_is_compatible("ti,omap5-uevm")) - legacy_init_ehci_clk("auxclk1_ck"); } #ifdef CONFIG_SOC_OMAP2420 -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/6] Add USB Host support for OMAP5 uevm for 3.13
Hi, This patch series provide USB host support for the OMAP5 uEVM board. As ethernet port is over USB, it brings up ethernet as well. Series depends on the OMAP clock tree DT data series by Tero Kristo [1] Tested on OMAP5 uEVM and OMAP4 Panda. cheers, -roger [1] - OMAP Clock DT conversion http://www.spinics.net/lists/arm-kernel/msg275311.html Roger Quadros (6): ARM: OMAP5: hwmod data: Add USB Host and TLL modules ARM: dts: OMAP5: Add 60MHz clock reference to USB Host module ARM: dts: omap4-panda: Provide USB PHY clock ARM: dts: omap5-uevm: Provide USB PHY clock Revert "ARM: OMAP2+: Provide alias to USB PHY clock" mfd: omap-usb: prepare/unprepare clock while enable/disable arch/arm/boot/dts/omap4-panda-common.dtsi |8 +-- arch/arm/boot/dts/omap5-uevm.dts |8 +-- arch/arm/boot/dts/omap5.dtsi |2 + arch/arm/mach-omap2/board-generic.c| 23 +- arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 135 drivers/mfd/omap-usb-host.c| 16 ++-- drivers/mfd/omap-usb-tll.c |4 +- 7 files changed, 152 insertions(+), 44 deletions(-) -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 3/6] ARM: dts: omap4-panda: Provide USB PHY clock
The USB PHY gets its clock from AUXCLK3. Provide this information. Signed-off-by: Roger Quadros --- arch/arm/boot/dts/omap4-panda-common.dtsi |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi index 3e6801c..f90a1d4 100644 --- a/arch/arm/boot/dts/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi @@ -83,12 +83,8 @@ compatible = "usb-nop-xceiv"; reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; /* gpio_62 */ vcc-supply = <&hsusb1_power>; - /** -* FIXME: -* put the right clock phandle here when available -* clocks = <&auxclk3>; -* clock-names = "main_clk"; -*/ + clocks = <&auxclk3_ck>; + clock-names = "main_clk"; clock-frequency = <1920>; }; -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/6] ARM: OMAP5: hwmod data: Add USB Host and TLL modules
Add hwmod data for High Speed USB host and TLL modules CC: Paul Walmsley Signed-off-by: Roger Quadros --- arch/arm/mach-omap2/omap_hwmod_54xx_data.c | 135 1 files changed, 135 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c index 1a21a81..1dd2c20 100644 --- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c @@ -1501,6 +1501,123 @@ static struct omap_hwmod omap54xx_uart6_hwmod = { }; /* + * 'usb_host_hs' class + * high-speed multi-port usb host controller + */ + +static struct omap_hwmod_class_sysconfig omap54xx_usb_host_hs_sysc = { + .rev_offs = 0x, + .sysc_offs = 0x0010, + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS | + SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | + MSTANDBY_SMART | MSTANDBY_SMART_WKUP), + .sysc_fields= &omap_hwmod_sysc_type2, +}; + +static struct omap_hwmod_class omap54xx_usb_host_hs_hwmod_class = { + .name = "usb_host_hs", + .sysc = &omap54xx_usb_host_hs_sysc, +}; + +static struct omap_hwmod omap54xx_usb_host_hs_hwmod = { + .name = "usb_host_hs", + .class = &omap54xx_usb_host_hs_hwmod_class, + .clkdm_name = "l3init_clkdm", + /* +* Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock +* id: i660 +* +* Description: +* In the following configuration : +* - USBHOST module is set to smart-idle mode +* - PRCM asserts idle_req to the USBHOST module ( This typically +* happens when the system is going to a low power mode : all ports +* have been suspended, the master part of the USBHOST module has +* entered the standby state, and SW has cut the functional clocks) +* - an USBHOST interrupt occurs before the module is able to answer +* idle_ack, typically a remote wakeup IRQ. +* Then the USB HOST module will enter a deadlock situation where it +* is no more accessible nor functional. +* +* Workaround: +* Don't use smart idle; use only force idle, hence HWMOD_SWSUP_SIDLE +*/ + + /* +* Errata: USB host EHCI may stall when entering smart-standby mode +* Id: i571 +* +* Description: +* When the USBHOST module is set to smart-standby mode, and when it is +* ready to enter the standby state (i.e. all ports are suspended and +* all attached devices are in suspend mode), then it can wrongly assert +* the Mstandby signal too early while there are still some residual OCP +* transactions ongoing. If this condition occurs, the internal state +* machine may go to an undefined state and the USB link may be stuck +* upon the next resume. +* +* Workaround: +* Don't use smart standby; use only force standby, +* hence HWMOD_SWSUP_MSTANDBY +*/ + + /* +* During system boot; If the hwmod framework resets the module +* the module will have smart idle settings; which can lead to deadlock +* (above Errata Id:i660); so, dont reset the module during boot; +* Use HWMOD_INIT_NO_RESET. +*/ + + .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY | + HWMOD_INIT_NO_RESET, + .main_clk = "l3init_60m_fclk", + .prcm = { + .omap4 = { + .clkctrl_offs = OMAP54XX_CM_L3INIT_USB_HOST_HS_CLKCTRL_OFFSET, + .context_offs = OMAP54XX_RM_L3INIT_USB_HOST_HS_CONTEXT_OFFSET, + .modulemode = MODULEMODE_SWCTRL, + }, + }, +}; + +/* + * 'usb_tll_hs' class + * usb_tll_hs module is the adapter on the usb_host_hs ports + */ + +static struct omap_hwmod_class_sysconfig omap54xx_usb_tll_hs_sysc = { + .rev_offs = 0x, + .sysc_offs = 0x0010, + .syss_offs = 0x0014, + .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | + SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | + SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), + .sysc_fields= &omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class omap54xx_usb_tll_hs_hwmod_class = { + .name = "usb_tll_hs", + .sysc = &omap54xx_usb_tll_hs_sysc, +}; + +static struct omap_hwmod omap54xx_usb_tll_hs_hwmod = { + .name = "usb_tll_hs", + .class = &omap54xx_usb_tll_hs_hwmod_class, + .clkdm_name = "l3init_clkdm", + .main_clk
[PATCH v2 6/6] mfd: omap-usb: prepare/unprepare clock while enable/disable
This should fix the following warning at boot on OMAP5 uEVM [8.783155] WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:883 __clk_enable+0x94/0xa4() CC: Samuel Ortiz CC: Lee Jones CC: Tero Kristo Signed-off-by: Roger Quadros --- drivers/mfd/omap-usb-host.c | 16 drivers/mfd/omap-usb-tll.c |4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 29ee54d..a5b91f1 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -328,13 +328,13 @@ static int usbhs_runtime_resume(struct device *dev) omap_tll_enable(pdata); if (!IS_ERR(omap->ehci_logic_fck)) - clk_enable(omap->ehci_logic_fck); + clk_prepare_enable(omap->ehci_logic_fck); for (i = 0; i < omap->nports; i++) { switch (pdata->port_mode[i]) { case OMAP_EHCI_PORT_MODE_HSIC: if (!IS_ERR(omap->hsic60m_clk[i])) { - r = clk_enable(omap->hsic60m_clk[i]); + r = clk_prepare_enable(omap->hsic60m_clk[i]); if (r) { dev_err(dev, "Can't enable port %d hsic60m clk:%d\n", @@ -343,7 +343,7 @@ static int usbhs_runtime_resume(struct device *dev) } if (!IS_ERR(omap->hsic480m_clk[i])) { - r = clk_enable(omap->hsic480m_clk[i]); + r = clk_prepare_enable(omap->hsic480m_clk[i]); if (r) { dev_err(dev, "Can't enable port %d hsic480m clk:%d\n", @@ -354,7 +354,7 @@ static int usbhs_runtime_resume(struct device *dev) case OMAP_EHCI_PORT_MODE_TLL: if (!IS_ERR(omap->utmi_clk[i])) { - r = clk_enable(omap->utmi_clk[i]); + r = clk_prepare_enable(omap->utmi_clk[i]); if (r) { dev_err(dev, "Can't enable port %d clk : %d\n", @@ -382,15 +382,15 @@ static int usbhs_runtime_suspend(struct device *dev) switch (pdata->port_mode[i]) { case OMAP_EHCI_PORT_MODE_HSIC: if (!IS_ERR(omap->hsic60m_clk[i])) - clk_disable(omap->hsic60m_clk[i]); + clk_disable_unprepare(omap->hsic60m_clk[i]); if (!IS_ERR(omap->hsic480m_clk[i])) - clk_disable(omap->hsic480m_clk[i]); + clk_disable_unprepare(omap->hsic480m_clk[i]); /* Fall through as utmi_clks were used in HSIC mode */ case OMAP_EHCI_PORT_MODE_TLL: if (!IS_ERR(omap->utmi_clk[i])) - clk_disable(omap->utmi_clk[i]); + clk_disable_unprepare(omap->utmi_clk[i]); break; default: break; @@ -398,7 +398,7 @@ static int usbhs_runtime_suspend(struct device *dev) } if (!IS_ERR(omap->ehci_logic_fck)) - clk_disable(omap->ehci_logic_fck); + clk_disable_unprepare(omap->ehci_logic_fck); omap_tll_disable(pdata); diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c index e59ac4c..1e57712 100644 --- a/drivers/mfd/omap-usb-tll.c +++ b/drivers/mfd/omap-usb-tll.c @@ -429,7 +429,7 @@ int omap_tll_enable(struct usbhs_omap_platform_data *pdata) if (IS_ERR(tll->ch_clk[i])) continue; - r = clk_enable(tll->ch_clk[i]); + r = clk_prepare_enable(tll->ch_clk[i]); if (r) { dev_err(tll_dev, "Error enabling ch %d clock: %d\n", i, r); @@ -460,7 +460,7 @@ int omap_tll_disable(struct usbhs_omap_platform_data *pdata) for (i = 0; i < tll->nch; i++) { if (omap_usb_mode_needs_tll(pdata->port_mode[i])) { if (!IS_ERR(tll->ch_clk[i])) - clk_disable(tll->ch_clk[i]); + clk_disable_unprepare(tll->ch_clk[i]); } } -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 2/6] ARM: dts: OMAP5: Add 60MHz clock reference to USB Host module
USB Host driver (drivers/mfd/omap-usb-host.c) expects the 60MHz reference clock to be named "init_60m_fclk". Provide this information. Signed-off-by: Roger Quadros --- arch/arm/boot/dts/omap5.dtsi |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi index edc801f..6f98be2 100644 --- a/arch/arm/boot/dts/omap5.dtsi +++ b/arch/arm/boot/dts/omap5.dtsi @@ -703,6 +703,8 @@ #address-cells = <1>; #size-cells = <1>; ranges; + clocks = <&l3init_60m_fclk>; + clock-names = "init_60m_fclk"; usbhsohci: ohci@4a064800 { compatible = "ti,ohci-omap3", "usb-ohci"; -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 4/6] ARM: dts: omap5-uevm: Provide USB PHY clock
The HS USB 2 PHY gets its clock from AUXCLK1. Provide this information. Signed-off-by: Roger Quadros --- arch/arm/boot/dts/omap5-uevm.dts |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts index 748f6bf..6a0d73c 100644 --- a/arch/arm/boot/dts/omap5-uevm.dts +++ b/arch/arm/boot/dts/omap5-uevm.dts @@ -31,12 +31,8 @@ hsusb2_phy: hsusb2_phy { compatible = "usb-nop-xceiv"; reset-gpios = <&gpio3 16 GPIO_ACTIVE_LOW>; /* gpio3_80 HUB_NRESET */ - /** - * FIXME - * Put the right clock phandle here when available - * clocks = <&auxclk1>; - * clock-names = "main_clk"; - */ + clocks = <&auxclk1_ck>; + clock-names = "main_clk"; clock-frequency = <1920>; }; -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] HID: logitech - lg2ff: Add IDs for Formula Vibration Feedback Wheel
Hey guys, I assume that we're talking about this wheel (http://www.logitech.com/en-roeu/support/298)? Does the wheel have an actual FFB servo or does it have just a rumble motor that shakes the wheel? If it's the latter, supporting it in lg2ff is a way to go. Description in KConfig should probably be updated to reflect this. As for the HID descriptors, Simon's suggestion will work just fine. Alternatively you can use Wireshark which can use usbmon to capture USB traffic. (Wireshark must run as root and usbmon module must be loaded before Wireshark starts). We can hack the descriptor in hid-logitech just like we did it for DFP. If we come across more wheels that need a hacked descriptor, perhaps we should consider handling the raw data ourselves (check out the Wii remote driver for details)... Michal. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: musb: dsps: disable the otg_timer while going to sleep
Testing with "freeze" I run into: | PM: Syncing filesystems ... done. | PM: Preparing system for freeze sleep | Freezing user space processes ... (elapsed 0.002 seconds) done. | Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done. | PM: Entering freeze sleep | usb usb2: usb auto-resume | hub 2-0:1.0: hub_resume | hub 2-0:1.0: hub_suspend | usb usb2: bus suspend, wakeup 0 | usb usb1: usb auto-resume | hub 1-0:1.0: hub_resume | hub 1-0:1.0: hub_suspend | usb usb1: bus suspend, wakeup 0 | PM: suspend of devices complete after 54.622 msecs | PM: late suspend of devices complete after 4.782 msecs | PM: noirq suspend of devices complete after 4.990 msecs | Unhandled fault: external abort on non-linefetch (0x1008) at 0xf0442460 | Internal error: : 1008 [#1] ARM | PC is at otg_timer+0x28/0x140 [musb_dsps] This is comming from first dsps_readb() in otg_timer(). The problem is that the device is already suspended (the clocks are off) and the timer tries to access register which fails. Since there is no need to keep this timer aroud while the device is going to suspend I suggest to remove the timer in suspend and queue it in the resume path. Signed-off-by: Sebastian Andrzej Siewior --- I don't have the "suspend" target in "state" just the "freezer" and with it I get into trouble in the otg_timer(). This triggers a few seconds after the suspend but since this depends on timming, it might trigger just a few secs after the suspend. What about the this? drivers/usb/musb/musb_dsps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index ced2b76..61b3f3e 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -659,6 +659,7 @@ static int dsps_suspend(struct device *dev) glue->context.tx_mode = dsps_readl(mbase, wrp->tx_mode); glue->context.rx_mode = dsps_readl(mbase, wrp->rx_mode); + del_timer_sync(&glue->timer); return 0; } @@ -679,6 +680,7 @@ static int dsps_resume(struct device *dev) musb->port_reset_state = false; schedule_work(&musb->port_reset_work); + mod_timer(&glue->timer, jiffies + wrp->poll_seconds * HZ); return 0; } -- 1.8.4.rc3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: XHCI: Handling of Zero length packet in data stage
On Mon, 7 Oct 2013, Sarah Sharp wrote: > > i am using 3.10 kernel. Also i looked at tip i see same implementation for > > process_ctrl_td() > > > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/host/xhci-ring.c > > Yeah, the implementation has always been this way. I've known since the > beginning of writing the xHCI driver that it needs to handle zero-length > data phases, but hadn't had ever had a report that it was required by a > device under Linux. This code, near the end of process_ctrl_td(), looks a little strange: /* * Did we transfer any data, despite the errors that might have * happened? I.e. did we get past the setup stage? */ if (event_trb != ep_ring->dequeue) { /* The event was for the status stage */ if (event_trb == td->last_trb) { if (td->urb->actual_length != 0) { /* Don't overwrite a previously set error code */ if ((*status == -EINPROGRESS || *status == 0) && (td->urb->transfer_flags & URB_SHORT_NOT_OK)) /* Did we already see a short data * stage? */ *status = -EREMOTEIO; If you already saw a short data stage, why isn't the status already set to -EREMOTEIO? Also what's the reason for the test "td->urb->actual_length != 0"? What does this have to do with getting a short data stage? Are you assuming that at this point, actual_length will be nonzero if and only if there was a short data stage? } else { td->urb->actual_length = td->urb->transfer_buffer_length; } What's the purpose of this clause? It looks like the driver is confusing "actual_length == 0" with "actual_length was never set". What if actual_length _was_ previously set, but it was set to 0? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Switching OMAP2430 MUSB between host and device mode
Felipe: I've got an Android device that uses the omap2430 musb driver. It's configured to go into device mode when it starts up, which I guess is the normal thing for Android devices to do. Can you explain how to switch the controller over to host mode (and back)? I tried writing "host" to the sysfs "mode" attribute, but all that happened was an immediate crash and reboot. (Related to this, it is notable that the omap2430_musb_set_mode() routine ignores its second argument, musb_mode. That looks awfully strange, even if it is right.) Thanks, Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[no subject]
I am Mr James Scott a private lender,I give out affordable loan at 3% interest rate contact me for more Information. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Looking for a USB device that uses cdc-wdm driver
Hi Oliver, I am trying to verify a fix for the cdc-wdm driver and am having trouble figuring out what devices requires that driver. It seems related to cell phones but I wasn't sure if there was a particular one or all of them in general (I couldn't get my cell to use it). Thanks in advance! Cheers, Don -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Looking for a USB device that uses cdc-wdm driver
Don Zickus writes: > I am trying to verify a fix for the cdc-wdm driver and am having trouble > figuring out what devices requires that driver. It seems related to cell > phones but I wasn't sure if there was a particular one or all of them in > general (I couldn't get my cell to use it). Thanks in advance! The Ericsson MBM devices use it. E.g F3507g, F5521gw etc. Bjørn -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 2/3] usb: phy: Add Qualcomm SS-USB and HS-USB drivers for DW PHY's
Hi Stan, On Mon, 2013-10-07 at 12:22 +0300, Stanimir Varbanov wrote: > Hi Ivan, > > Few comments below. > > On 10/07/2013 10:44 AM, Ivan T. Ivanov wrote: > > From: "Ivan T. Ivanov" > > > > These drivers handles control and configuration of the HS > > and SS USB PHY transceivers. They are part of the driver > > which manage Synopsys DesignWare USB3 controller stack > > inside Qualcomm SoC's. > > > > Signed-off-by: Ivan T. Ivanov > > --- > > drivers/usb/phy/Kconfig | 11 ++ > > drivers/usb/phy/Makefile|2 + > > drivers/usb/phy/phy-msm-dw-hs.c | 329 ++ > > drivers/usb/phy/phy-msm-dw-ss.c | 375 > > +++ > > 4 files changed, 717 insertions(+) > > create mode 100644 drivers/usb/phy/phy-msm-dw-hs.c > > create mode 100644 drivers/usb/phy/phy-msm-dw-ss.c > > > > diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig > > index d5589f9..bbb2d0e 100644 > > --- a/drivers/usb/phy/Kconfig > > +++ b/drivers/usb/phy/Kconfig > > @@ -214,6 +214,17 @@ config USB_RCAR_PHY > > To compile this driver as a module, choose M here: the > > module will be called phy-rcar-usb. > > > > +config USB_MSM_DW_PHYS > > + tristate "Qualcomm USB controller DW PHY's wrappers support" > > + depends on (USB || USB_GADGET) && ARCH_MSM > > + select USB_PHY > > + help > > + Enable this to support the DW USB PHY transceivers on MSM chips > > + with DWC3 USB core. It handles PHY initialization, clock > > + management required after resetting the hardware and power > > + management. This driver is required even for peripheral only or > > + host only mode configurations. > > + > > config USB_ULPI > > bool "Generic ULPI Transceiver Driver" > > depends on ARM > > diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile > > index 2135e85..4813eb5 100644 > > --- a/drivers/usb/phy/Makefile > > +++ b/drivers/usb/phy/Makefile > > @@ -26,6 +26,8 @@ obj-$(CONFIG_USB_EHCI_TEGRA) += > > phy-tegra-usb.o > > obj-$(CONFIG_USB_GPIO_VBUS)+= phy-gpio-vbus-usb.o > > obj-$(CONFIG_USB_ISP1301) += phy-isp1301.o > > obj-$(CONFIG_USB_MSM_OTG) += phy-msm-usb.o > > +obj-$(CONFIG_USB_MSM_DW_PHYS) += phy-msm-dw-hs.o > > +obj-$(CONFIG_USB_MSM_DW_PHYS) += phy-msm-dw-ss.o > > obj-$(CONFIG_USB_MV_OTG) += phy-mv-usb.o > > obj-$(CONFIG_USB_MXS_PHY) += phy-mxs-usb.o > > obj-$(CONFIG_USB_RCAR_PHY) += phy-rcar-usb.o > > diff --git a/drivers/usb/phy/phy-msm-dw-hs.c > > b/drivers/usb/phy/phy-msm-dw-hs.c > > new file mode 100644 > > index 000..d29c1f1 > > --- /dev/null > > +++ b/drivers/usb/phy/phy-msm-dw-hs.c > > @@ -0,0 +1,329 @@ > > +/* Copyright (c) 2013, Code Aurora Forum. All rights reserved. > > + * > > + * This program is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License version 2 and > > + * only version 2 as published by the Free Software Foundation. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +/** > > + * USB QSCRATCH Hardware registers > > + */ > > +#define QSCRATCH_CTRL_REG (0x04) > > +#define QSCRATCH_GENERAL_CFG (0x08) > > +#define PHY_CTRL_REG (0x10) > > +#define PARAMETER_OVERRIDE_X_REG (0x14) > > +#define CHARGING_DET_CTRL_REG (0x18) > > +#define CHARGING_DET_OUTPUT_REG(0x1c) > > +#define ALT_INTERRUPT_EN_REG (0x20) > > +#define PHY_IRQ_STAT_REG (0x24) > > +#define CGCTL_REG (0x28) > > + > > Please remove braces above and below. ok > > > +#define PHY_3P3_VOL_MIN305 /* uV */ > > +#define PHY_3P3_VOL_MAX330 /* uV */ > > +#define PHY_3P3_HPM_LOAD 16000 /* uA */ > > + > > +#define PHY_1P8_VOL_MIN180 /* uV */ > > +#define PHY_1P8_VOL_MAX180 /* uV */ > > +#define PHY_1P8_HPM_LOAD 19000 /* uA */ > > + > > +/* TODO: these are suspicious */ > > +#define USB_VDDCX_NO 1 /* index */ > > +#define USB_VDDCX_MIN 5 /* index */ > > +#define USB_VDDCX_MAX 7 /* index */ > > + > > +struct msm_dw_hs_phy { > > + struct usb_phy phy; > > + void __iomem*base; > > + struct device *dev; > > + > > + struct clk *xo_clk; > > + struct clk *sleep_a_clk; > > + > > + struct regulator*v3p3; > > + struct re
Re: [PATCH v6 3/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver
Hi Stan, On Mon, 2013-10-07 at 12:28 +0300, Stanimir Varbanov wrote: > Hi Ivan, > > Minor comments below. > > On 10/07/2013 10:44 AM, Ivan T. Ivanov wrote: > > From: "Ivan T. Ivanov" > > > > DWC3 glue layer is hardware layer around Synopsys DesignWare > > USB3 core. Its purpose is to supply Synopsys IP with required > > clocks, voltages and interface it with the rest of the SoC. > > > > Signed-off-by: Ivan T. Ivanov > > --- > > drivers/usb/dwc3/Kconfig|8 +++ > > drivers/usb/dwc3/Makefile |1 + > > drivers/usb/dwc3/dwc3-msm.c | 168 > > +++ > > 3 files changed, 177 insertions(+) > > create mode 100644 drivers/usb/dwc3/dwc3-msm.c > > > > diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig > > index 70fc430..4c7b5a4 100644 > > --- a/drivers/usb/dwc3/Kconfig > > +++ b/drivers/usb/dwc3/Kconfig > > @@ -59,6 +59,14 @@ config USB_DWC3_EXYNOS > > Recent Exynos5 SoCs ship with one DesignWare Core USB3 IP inside, > > say 'Y' or 'M' if you have one such device. > > > > +config USB_DWC3_MSM > > + tristate "Qualcomm MSM/APQ Platforms" > > + default USB_DWC3 > > + select USB_MSM_DWC3_PHYS > > + help > > + Recent Qualcomm SoCs ship with one DesignWare Core USB3 IP inside, > > + say 'Y' or 'M' if you have one such device. > > + > > config USB_DWC3_PCI > > tristate "PCIe-based Platforms" > > depends on PCI > > diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile > > index dd17601..a90de66 100644 > > --- a/drivers/usb/dwc3/Makefile > > +++ b/drivers/usb/dwc3/Makefile > > @@ -31,4 +31,5 @@ endif > > > > obj-$(CONFIG_USB_DWC3_OMAP)+= dwc3-omap.o > > obj-$(CONFIG_USB_DWC3_EXYNOS) += dwc3-exynos.o > > +obj-$(CONFIG_USB_DWC3_MSM) += dwc3-msm.o > > obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o > > diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c > > new file mode 100644 > > index 000..1d73f92 > > --- /dev/null > > +++ b/drivers/usb/dwc3/dwc3-msm.c > > @@ -0,0 +1,168 @@ > > +/* Copyright (c) 2013, The Linux Foundation. All rights reserved. > > + * > > + * This program is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License version 2 and > > + * only version 2 as published by the Free Software Foundation. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +struct dwc3_msm { > > + struct device *dev; > > + > > + struct clk *core_clk; > > + struct clk *iface_clk; > > + struct clk *sleep_clk; > > + struct clk *utmi_clk; > > + > > + struct regulator*gdsc; > > +}; > > + > > +static int dwc3_msm_probe(struct platform_device *pdev) > > +{ > > + struct device_node *node = pdev->dev.of_node; > > + struct dwc3_msm *mdwc; > > + struct resource *res; > > + void __iomem *tcsr; > > + int ret = 0; > > + > > + mdwc = devm_kzalloc(&pdev->dev, sizeof(*mdwc), GFP_KERNEL); > > + if (!mdwc) > > + return -ENOMEM; > > + > > + platform_set_drvdata(pdev, mdwc); > > + > > + mdwc->dev = &pdev->dev; > > + > > + mdwc->gdsc = devm_regulator_get(mdwc->dev, "gdsc"); > > + > > + mdwc->core_clk = devm_clk_get(mdwc->dev, "core"); > > + if (IS_ERR(mdwc->core_clk)) { > > + dev_dbg(mdwc->dev, "failed to get core clock\n"); > > + return PTR_ERR(mdwc->core_clk); > > + } > > + > > + mdwc->iface_clk = devm_clk_get(mdwc->dev, "iface"); > > + if (IS_ERR(mdwc->iface_clk)) { > > + dev_dbg(mdwc->dev, "failed to get iface clock\n"); > > + return PTR_ERR(mdwc->iface_clk); > > + } > > + > > + mdwc->sleep_clk = devm_clk_get(mdwc->dev, "sleep"); > > + if (IS_ERR(mdwc->sleep_clk)) { > > + dev_dbg(mdwc->dev, "failed to get sleep clock\n"); > > + return PTR_ERR(mdwc->sleep_clk); > > + } > > + > > + mdwc->utmi_clk = devm_clk_get(mdwc->dev, "utmi"); > > + if (IS_ERR(mdwc->utmi_clk)) { > > + dev_dbg(mdwc->dev, "failed to get utmi clock\n"); > > + return PTR_ERR(mdwc->utmi_clk); > > + } > > I'm not sure that those dev_dbg() are useful at all. They are, if you deal with WIP clocks and regulators implementations, which is the case for this platform. > > > + > > + if (!IS_ERR(mdwc->gdsc)) { > > + ret = regulator_enable(mdwc->gdsc); > > + if (ret) > > + dev_err(mdwc->dev, "cannot enable gdsc\n"); > > + } > > + > > + /* > > +* DWC3 Core requires its CORE CLK (aka maste
Re: Looking for a USB device that uses cdc-wdm driver
On Tue, 2013-10-08 at 11:29 -0400, Don Zickus wrote: > Hi Oliver, > > I am trying to verify a fix for the cdc-wdm driver and am having trouble > figuring out what devices requires that driver. It seems related to cell > phones but I wasn't sure if there was a particular one or all of them in > general (I couldn't get my cell to use it). Thanks in advance! Find an Ericsson F3507 or F3607 PCIe minicard WWAN modem, like: http://www.ebay.com/itm/New-Unlocked-Ericsson-F3607GW-DELL-Wireless-5540-3G-GPS-Mini-WWAN-Card-/290659200462?pt=US_Internal_Network_Cards&hash=item43aca36dce They're cheap. They expose a couple cdc-wdm ports, one of which speaks AT commands and another which might do the GPS stuff. You don't need a SIM. If you're at a loss for how to connect it to your computer, or your BIOS locks out unauthorized cards, grab one of these: http://www.hwtools.net/Adapter/USBMS-F.html which is a small PCIe minicard carrier with a USB connector. Dan -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/1] Possibly fix USB OTG on GTA04 and N900
Hi, On Mon, Oct 07, 2013 at 04:28:12PM +0300, Roger Quadros wrote: > USB OTG on these boards might be broken on Greg's usb-next branch [1] > after the Generic PHY framework and associated patches were merged. > > This is a probable fix but I'm not able to test these boards. Please > give it a try and your Ack if it works. Thanks. > > [1] - git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git I have tested the Nokia N900 part of the patch. Without this patch the USB port does not work: [1.015014] musb-omap2430 480ab000.usb_otg_hs: unable to find phy With the patch everything seems to work. Tested-by: Sebastian Reichel -- Sebastian signature.asc Description: Digital signature
Re: Looking for a USB device that uses cdc-wdm driver
On Tue, Oct 08, 2013 at 05:36:46PM +0200, Bjørn Mork wrote: > Don Zickus writes: > > > I am trying to verify a fix for the cdc-wdm driver and am having trouble > > figuring out what devices requires that driver. It seems related to cell > > phones but I wasn't sure if there was a particular one or all of them in > > general (I couldn't get my cell to use it). Thanks in advance! > > The Ericsson MBM devices use it. E.g F3507g, F5521gw etc. Thanks! Cheers, Don -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Looking for a USB device that uses cdc-wdm driver
On Tue, Oct 08, 2013 at 11:10:52AM -0500, Dan Williams wrote: > On Tue, 2013-10-08 at 11:29 -0400, Don Zickus wrote: > > Hi Oliver, > > > > I am trying to verify a fix for the cdc-wdm driver and am having trouble > > figuring out what devices requires that driver. It seems related to cell > > phones but I wasn't sure if there was a particular one or all of them in > > general (I couldn't get my cell to use it). Thanks in advance! > > Find an Ericsson F3507 or F3607 PCIe minicard WWAN modem, like: > > http://www.ebay.com/itm/New-Unlocked-Ericsson-F3607GW-DELL-Wireless-5540-3G-GPS-Mini-WWAN-Card-/290659200462?pt=US_Internal_Network_Cards&hash=item43aca36dce > > They're cheap. They expose a couple cdc-wdm ports, one of which speaks > AT commands and another which might do the GPS stuff. You don't need a > SIM. If you're at a loss for how to connect it to your computer, or > your BIOS locks out unauthorized cards, grab one of these: > > http://www.hwtools.net/Adapter/USBMS-F.html > > which is a small PCIe minicard carrier with a USB connector. Thanks! Cheers, Don -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
no reset_resume for driver snd-usb-audio for logitech headset H600
Hello, please help me with the bug for my Logitech Headset; https://bugzilla.kernel.org/show_bug.cgi?id=62691 Bug ID: 62691 Summary: no reset_resume for driver snd-usb-audio for logitech headset H600 Thank you Best regards, Bernhard -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
USB-related NULL pointer dereference
I rather suddenly got a NULL pointer dereference yesterday, running 3.10.9. Curiously, the same re-occurred on my next boot (shutdown, cold poweron), around when udev was loading modules. After this, I shutdown again, and turned the PSU switch off for a few seconds - at the next boot, the problem stopped. [613257.292304] BUG: unable to handle kernel NULL pointer dereference at (null) [613257.292337] IP: [] hub_quiesce+0x4e/0xb0 [usbcore] [613257.292363] PGD 411313067 PUD 411380067 PMD 0 [613257.292386] Oops: [#1] PREEMPT SMP [613257.292405] Modules linked in: usb_storage fuse netconsole configfs cfq_iosched bridge stp llc ipv6 cdc_acm ftdi_sio cp210x usbserial hid_generic usbhid hid evdev coretemp hwmon mperf 8250_pci intel_powerclamp 8250 serial_core xhci_hcd ehci_pci ehci_hcd i915 video drm_kms_helper drm i2c_algo_bit ata_generic usbcore i2c_i801 kvm_intel kvm psmouse firewire_ohci firewire_core usb_common tpm_tis crc_itu_t tpm tpm_bios pata_acpi snd_hda_codec_hdmi snd_hda_codec_realtek e1000e 8139too rtc_cmos mii ptp pps_core snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_page_alloc snd_timer snd button [613257.292748] CPU: 0 PID: 1284 Comm: khubd Tainted: GW3.10.9- gentoo #1 [613257.292767] Hardware name: /DQ67SW, BIOS SWQ6710H.86A.0062.2012.0418.1112 04/18/2012 [613257.292792] task: 880429abf060 ti: 880426024000 task.ti: 880426024000 [613257.292813] RIP: 0010:[] [] hub_quiesce+0x4e/0xb0 [usbcore] [613257.292843] RSP: :880426025828 EFLAGS: 00010246 [613257.292859] RAX: 8800b86273c0 RBX: 8803fb069400 RCX: 0006 [613257.292878] RDX: RSI: 7fff RDI: [613257.292898] RBP: 880426025848 R08: R09: [613257.292917] R10: 06a6 R11: R12: 8804020cc000 [613257.292936] R13: R14: 8803b6736430 R15: 0096 [613257.292956] FS: () GS:88043e20() knlGS: [613257.292977] CS: 0010 DS: ES: CR0: 80050033 [613257.292993] CR2: CR3: 000409a08000 CR4: 000407f0 [613257.293012] DR0: DR1: DR2: [613257.293032] DR3: DR6: 0ff0 DR7: 0400 [613257.293051] Stack: [613257.293057] 880426025848 8803fb069400 8804020cc088 8803b6736400 [613257.293089] 880426025878 a0300679 8803fb069400 8803b6736400 [613257.293121] 8804020cc000 880428dc2000 880426025918 a0302fa1 [613257.293152] Call Trace: [613257.293164] [] hub_disconnect+0x79/0x140 [usbcore] [613257.293184] [] hub_probe+0x301/0x820 [usbcore] [613257.293204] [] usb_probe_interface+0x1a1/0x290 [usbcore] [613257.293226] [] driver_probe_device+0x76/0x240 [613257.293243] [] __device_attach+0x4b/0x60 [613257.293259] [] ? __driver_attach+0xa0/0xa0 [613257.293276] [] bus_for_each_drv+0x54/0x90 [613257.293292] [] device_attach+0x98/0xb0 [613257.293308] [] bus_probe_device+0x98/0xc0 [613257.293324] [] device_add+0x5b4/0x670 [613257.293341] [] ? usb_set_device_state+0xab/0x180 [usbcore] [613257.293363] [] usb_set_configuration+0x5f5/0x810 [usbcore] [613257.293385] [] generic_probe+0x32/0x90 [usbcore] [613257.293405] [] usb_probe_device+0x2d/0x60 [usbcore] [613257.293423] [] driver_probe_device+0x76/0x240 [613257.293439] [] __device_attach+0x4b/0x60 [613257.293455] [] ? __driver_attach+0xa0/0xa0 [613257.293471] [] bus_for_each_drv+0x54/0x90 [613257.293487] [] device_attach+0x98/0xb0 [613257.293503] [] bus_probe_device+0x98/0xc0 [613257.293518] [] device_add+0x5b4/0x670 [613257.293535] [] usb_new_device+0x1d7/0x370 [usbcore] [613257.293555] [] hub_thread+0x69c/0x1420 [usbcore] [613257.293573] [] ? abort_exclusive_wait+0xb0/0xb0 [613257.293592] [] ? hub_port_debounce+0xe0/0xe0 [usbcore] [613257.293611] [] kthread+0xbb/0xc0 [613257.293625] [] ? generic_processor_info+0x75/0x18a [613257.293643] [] ? kthread_freezable_should_stop+0x70/0x70 [613257.293662] [] ret_from_fork+0x7c/0xb0 [613257.293677] [] ? kthread_freezable_should_stop+0x70/0x70 [613257.293697] Code: 80 8b f0 00 00 00 02 41 83 fd 02 74 37 45 8b ac 24 78 04 00 00 45 85 ed 7e 2a 45 31 ed 48 8b 83 10 02 00 00 49 63 d5 48 8b 3c d0 <48> 83 3f 00 74 05 e8 07 fe ff ff 41 83 c5 01 45 39 ac 24 78 04 [613257.293956] RIP [] hub_quiesce+0x4e/0xb0 [usbcore] [613257.293979] RSP [613257.293988] CR2: [613257.301183] ---[ end trace 3347bc36b4bf0c05 ]--- [613258.409850] usb 4-1.5: reset full-speed USB device number 5 using ehci-pci -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: LTE vodafone K5150 (hilink) 12d1 1f16 ; 12d1 1575 cdc_ether mbim?
Am Montag, 7. Oktober 2013, 16:04:49 schrieben Sie: > Have you verified that the latest version of usb-modeswitch doesn't fix > this issue? I think I've seen reports that it does, but it would be > good if you could test that out and verify it. May be it is intention. Under win8 it does not change its ID. Do we make the same break as MS does. (cdc --> mbim?) I copy my statement from http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=3&t=1703 There are two modes: Windows 7 and before has 12d1 1575 Windows 8 uses 12d1 1f16 (without switching, or without ID-change) Windows 8 information: hardware IDs USB\VID_12D1&PID_1F16&REV_0102&MI_00 USB\VID_12D1&PID_1F16&MI_00 comatible IDs USB\Class_02&SubClass_0e&Prot_00 USB\Class_02&SubClass_0e USB\Class_02 lsusb -v with kernel 3.7 (like windows 7) Code: Bus 001 Device 004: ID 12d1:1575 Huawei Technologies Co., Ltd. Device Descriptor: bLength18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass2 Communications bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize064 idVendor 0x12d1 Huawei Technologies Co., Ltd. idProduct 0x1575 bcdDevice1.02 iManufacturer 5 Vodafone (Huawei) iProduct4 K5150 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 71 bNumInterfaces 2 bConfigurationValue 1 iConfiguration 2 configuration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 2 Communications bInterfaceSubClass 6 Ethernet Networking bInterfaceProtocol 0 iInterface 0 CDC Header: bcdCDC 1.10 CDC Ethernet: iMacAddress 1 582C80139263 bmEthernetStatistics0x0005 wMaxSegmentSize 1514 wNumberMCFilters0x0003 bNumberPowerFilters 1 CDC Union: bMasterInterface0 bSlaveInterface 1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes3 Transfer TypeInterrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 5 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass10 CDC Data bInterfaceSubClass 6 bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 32 Device Qualifier (for other device speed): bLength10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize064 bNumConfigurations 1 Device Status: 0x (Bus Powered) lsusb -v with kernel 3.11 (like windows 8?) Code: Bus 001 Device 003: ID 12d1:1f16 Huawei Technologies Co., Ltd. Device Descriptor: bLength18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 255 bMaxPacketSize064 idVendor 0x12d1 Huawei Technologies Co., Ltd. idProduct 0x1f16 bcdDevice1.02 iManufacturer 5 Vodafone (Huawei) iProduct4 K5150 iSerial 7 bNumConfigurations 2 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue
Re: no reset_resume for driver snd-usb-audio for logitech headset H600
On Tue, 8 Oct 2013 baum...@hotmail.com wrote: > Hello, > > please help me with the bug for my Logitech Headset; > > https://bugzilla.kernel.org/show_bug.cgi?id=62691 > > Bug ID: 62691 > Summary: no reset_resume for driver snd-usb-audio for logitech headset H600 > > Thank you > > Best regards, Bernhard Actually this should be brought to the attention of the ALSA developers (CC'ed). They are the people in charge of the snd-usb-audio driver. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] HID: logitech - lg2ff: Add IDs for Formula Vibration Feedback Wheel
> We can hack the descriptor in hid-logitech just > like we did it for DFP. If we come across more wheels that need a hacked > descriptor, perhaps we should consider handling the raw data ourselves > (check out the Wii remote driver for details)... We currently 'hack HID desc.' for the DF, DFP and MOMO-Red. The DFGT, G25 and G27 are pushed into native mode and automatically split the brake and accel axis. I'll get the 'hack HID desc.' done for Elias' wheel and the MOMO-black I picked last week. Should be done this week sometime. I think we've got every wheel variant covered unless the release more with different IDs (recently saw a new DFGT version). In the longer term we may wish to add an option/control to split (or not) the brake/accel as the user requests. I don't actually think that anyone wants combined axis, but there's no telling with some people ;-) Simon -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/3] arm: shmobile: lager: Add USBHS support
This adds USBHS PHY and registers USBHS device if the driver is enabled. Signed-off-by: Valentine Barshak --- arch/arm/mach-shmobile/board-lager.c | 115 +++ 1 file changed, 115 insertions(+) diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index a8d3ce6..f375eae 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include @@ -29,11 +30,14 @@ #include #include #include +#include #include #include #include #include #include +#include +#include #include #include #include @@ -165,6 +169,107 @@ static const struct resource ether_resources[] __initconst = { DEFINE_RES_IRQ(gic_spi(162)), }; +/* USBHS */ +#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC) +static const struct resource usbhs_resources[] __initconst = { + DEFINE_RES_MEM(0xe659, 0x100), + DEFINE_RES_IRQ(gic_spi(107)), +}; + +struct usbhs_private { + struct renesas_usbhs_platform_info info; + struct usb_phy *phy; +}; + +#define usbhs_get_priv(pdev) \ + container_of(renesas_usbhs_get_info(pdev), struct usbhs_private, info) + +static int usbhs_power_ctrl(struct platform_device *pdev, + void __iomem *base, int enable) +{ + struct usbhs_private *priv = usbhs_get_priv(pdev); + + if (!priv->phy) + return -ENODEV; + + if (enable) { + int retval = usb_phy_init(priv->phy); + + if (!retval) + retval = usb_phy_set_suspend(priv->phy, 0); + return retval; + } + + usb_phy_set_suspend(priv->phy, 1); + usb_phy_shutdown(priv->phy); + return 0; +} + +static int usbhs_hardware_init(struct platform_device *pdev) +{ + struct usbhs_private *priv = usbhs_get_priv(pdev); + struct usb_phy *phy; + + phy = usb_get_phy(USB_PHY_TYPE_USB2); + if (IS_ERR(phy)) + return PTR_ERR(phy); + + priv->phy = phy; + return 0; +} + +static int usbhs_hardware_exit(struct platform_device *pdev) +{ + struct usbhs_private *priv = usbhs_get_priv(pdev); + + if (!priv->phy) + return 0; + + usb_put_phy(priv->phy); + priv->phy = NULL; + return 0; +} + +static int usbhs_get_id(struct platform_device *pdev) +{ + return USBHS_GADGET; +} + +static struct usbhs_private usbhs_priv __initdata = { + .info = { + .platform_callback = { + .power_ctrl = usbhs_power_ctrl, + .hardware_init = usbhs_hardware_init, + .hardware_exit = usbhs_hardware_exit, + .get_id = usbhs_get_id, + }, + .driver_param = { + .buswait_bwait = 4, + }, + } +}; + +#define lager_register_usbhs() \ + platform_device_register_resndata(&platform_bus,\ + "renesas_usbhs", -1, \ + usbhs_resources, \ + ARRAY_SIZE(usbhs_resources), \ + &usbhs_priv.info, \ + sizeof(usbhs_priv.info)) +#else /* CONFIG_USB_RENESAS_USBHS_UDC */ +#define lager_register_usbhs() +#endif /* CONFIG_USB_RENESAS_USBHS_UDC */ + +/* USBHS PHY */ +static const struct rcar_gen2_phy_platform_data usbhs_phy_pdata __initconst = { + .chan0_pci = 0, /* Channel 0 is USBHS */ + .chan2_pci = 1, /* Channel 2 is PCI USB */ +}; + +static const struct resource usbhs_phy_resources[] __initconst = { + DEFINE_RES_MEM(0xe6590100, 0x100), +}; + static const struct pinctrl_map lager_pinctrl_map[] = { /* DU (CN10: ARGB0, CN13: LVDS) */ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", @@ -193,6 +298,9 @@ static const struct pinctrl_map lager_pinctrl_map[] = { "eth_rmii", "eth"), PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", "intc_irq0", "intc"), + /* USB0 */ + PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7790", + "usb0", "usb0"), }; static void __init lager_add_standard_devices(void) @@ -221,6 +329,13 @@ static void __init lager_add_standard_devices(void) ARRAY_SIZE(ether_resources), ðer_pdata, sizeof(ether_pdata)); + platform_device_register_resndata(&platform_bus, "usb_phy_rcar_gen2", + -1, usbhs_phy_resources, +
[PATCH 0/3] Add USBHS support to Lager (take 2)
This patch set adds internal USB PHY support to RCAR Gen2 SoC, and also enables USBHS for the Lager board. It has been updated, based on the comments to the previous version. The patches apply fine to the renesas-devel-20131008 tag of the renesas.git. The first patch also applies fine to the usb.git at kernel.org. It adds RCAR Gen2 phy driver which is used to configure the shared USB channels 0/2 and to control USBHS internal PHY. All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host) should acquire the USB phy first to set proper channel configuration. The other two patches add USBHS support to Lager board, which requires RCAR Gen2 phy driver. Changes from previous version: * use-counting and clock handling done in the usb_phy_init/shutdown callbacks only; * a minor typo in the comments fixed; * phy clean up moved to __rcar_gen2_usb_phy_shutdown function; * usb_phy_init/shutdown called from usbhs_power_ctrl callback to allow renesas_usbhs driver disable USB PHY completely when it is not needed. Valentine Barshak (3): usb: phy: Add RCAR Gen2 USB phy arm: shmobile: r8a7790: Add USBHS clock support arm: shmobile: lager: Add USBHS support arch/arm/mach-shmobile/board-lager.c| 106 ++ arch/arm/mach-shmobile/clock-r8a7790.c | 4 + drivers/usb/phy/Kconfig | 13 ++ drivers/usb/phy/Makefile| 1 + drivers/usb/phy/phy-rcar-gen2-usb.c | 255 include/linux/platform_data/usb-rcar-gen2-phy.h | 22 ++ 6 files changed, 401 insertions(+) create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: LTE vodafone K5150 (hilink) 12d1 1f16 ; 12d1 1575 cdc_ether mbim?
hpmini:~ # usb_modeswitch -j -v 12d1 -p 1f16 Search USB devices... Found device, searching for MBIM configuration... 2 hpmini:~ # usb_modeswitch -W -j -v 12d1 -p 1f16 Taking all parameters from the command line * usb_modeswitch: handle USB devices with multiple modes * Version 1.2.5 (C) Josua Dietze 2012 * Based on libusb0 (0.1.12 and above) ! PLEASE REPORT NEW CONFIGURATIONS ! DefaultVendor= 0x12d1 DefaultProduct= 0x1f16 TargetVendor= not set TargetProduct= not set TargetClass=not set TargetProductList="" DetachStorageOnly=0 HuaweiMode=0 SierraMode=0 SonyMode=0 QisdaMode=0 GCTMode=0 KobilMode=0 SequansMode=0 MobileActionMode=0 CiscoMode=0 MessageEndpoint= not set MessageContent="" NeedResponse=0 ResponseEndpoint= not set InquireDevice enabled (default) Success check disabled System integration mode disabled Search USB devices... Found device, searching for MBIM configuration... 2 hpmini:~ # -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] arm: shmobile: r8a7790: Add USBHS clock support
This adds USBHS clock support. Signed-off-by: Valentine Barshak --- arch/arm/mach-shmobile/clock-r8a7790.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c index a64f965..161d44e 100644 --- a/arch/arm/mach-shmobile/clock-r8a7790.c +++ b/arch/arm/mach-shmobile/clock-r8a7790.c @@ -186,6 +186,7 @@ enum { MSTP813, MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720, MSTP717, MSTP716, + MSTP704, MSTP522, MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304, MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, @@ -208,6 +209,7 @@ static struct clk mstp_clks[MSTP_NR] = { [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */ [MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */ [MSTP716] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 16, 0), /* HSCIF1 */ + [MSTP704] = SH_CLK_MSTP32(&mp_clk, SMSTPCR7, 4, 0), /* HSUSB */ [MSTP522] = SH_CLK_MSTP32(&extal_clk, SMSTPCR5, 22, 0), /* Thermal */ [MSTP315] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC0], SMSTPCR3, 15, 0), /* MMC0 */ [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_SD0], SMSTPCR3, 14, 0), /* SDHI0 */ @@ -296,6 +298,8 @@ static struct clk_lookup lookups[] = { CLKDEV_DEV_ID("ee22.mmcif", &mstp_clks[MSTP305]), CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]), CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), + CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP704]), + CLKDEV_ICK_ID("usbhs", "usb_phy_rcar_gen2", &mstp_clks[MSTP704]), }; #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31) \ -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] usb: phy: Add RCAR Gen2 USB phy
This adds RCAR Gen2 USB phy support. The driver configures USB channels 0/2 which are shared between PCI USB hosts and USBHS/USBSS devices. It also controls internal USBHS phy. Signed-off-by: Valentine Barshak --- drivers/usb/phy/Kconfig | 13 ++ drivers/usb/phy/Makefile| 1 + drivers/usb/phy/phy-rcar-gen2-usb.c | 255 include/linux/platform_data/usb-rcar-gen2-phy.h | 22 ++ 4 files changed, 291 insertions(+) create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index d5589f9..297062c 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -214,6 +214,19 @@ config USB_RCAR_PHY To compile this driver as a module, choose M here: the module will be called phy-rcar-usb. +config USB_RCAR_GEN2_PHY + tristate "Renesas R-Car Gen2 USB PHY support" + depends on ARCH_R8A7790 || ARCH_R8A7791 + select USB_PHY + help + Say Y here to add support for the Renesas R-Car Gen2 USB PHY driver. + It is typically used to control internal USB PHY for USBHS, + and to configure shared USB channels 0 and 2. + This driver supports R8A7790 and R8A7791. + + To compile this driver as a module, choose M here: the + module will be called phy-rcar-gen2-usb. + config USB_ULPI bool "Generic ULPI Transceiver Driver" depends on ARM diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index 2135e85..8c5b147 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -29,5 +29,6 @@ obj-$(CONFIG_USB_MSM_OTG) += phy-msm-usb.o obj-$(CONFIG_USB_MV_OTG) += phy-mv-usb.o obj-$(CONFIG_USB_MXS_PHY) += phy-mxs-usb.o obj-$(CONFIG_USB_RCAR_PHY) += phy-rcar-usb.o +obj-$(CONFIG_USB_RCAR_GEN2_PHY)+= phy-rcar-gen2-usb.o obj-$(CONFIG_USB_ULPI) += phy-ulpi.o obj-$(CONFIG_USB_ULPI_VIEWPORT)+= phy-ulpi-viewport.o diff --git a/drivers/usb/phy/phy-rcar-gen2-usb.c b/drivers/usb/phy/phy-rcar-gen2-usb.c new file mode 100644 index 000..a2e6f9f --- /dev/null +++ b/drivers/usb/phy/phy-rcar-gen2-usb.c @@ -0,0 +1,255 @@ +/* + * Renesas R-Car Gen2 USB phy driver + * + * Copyright (C) 2013 Renesas Solutions Corp. + * Copyright (C) 2013 Cogent Embedded, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +struct rcar_gen2_usb_phy_priv { + struct usb_phy phy; + void __iomem *base; + struct clk *clk; + spinlock_t lock; + int usecount; + u32 ugctrl2; +}; + +#define usb_phy_to_priv(p) container_of(p, struct rcar_gen2_usb_phy_priv, phy) + +/* Low Power Status register */ +#define USBHS_LPSTS_REG0x02 +#define USBHS_LPSTS_SUSPM (1 << 14) + +/* USB General control register */ +#define USBHS_UGCTRL_REG 0x80 +#define USBHS_UGCTRL_CONNECT (1 << 2) +#define USBHS_UGCTRL_PLLRESET (1 << 0) + +/* USB General control register 2 */ +#define USBHS_UGCTRL2_REG 0x84 +#define USBHS_UGCTRL2_USB0_PCI (1 << 4) +#define USBHS_UGCTRL2_USB0_HS (3 << 4) +#define USBHS_UGCTRL2_USB2_PCI (0 << 31) +#define USBHS_UGCTRL2_USB2_SS (1 << 31) + +/* USB General status register */ +#define USBHS_UGSTS_REG0x88 +#define USBHS_UGSTS_LOCK (3 << 8) + +/* Enable USBHS internal phy */ +static int __rcar_gen2_usbhs_phy_enable(void __iomem *base) +{ + u32 val; + int i; + + /* USBHS PHY power on */ + val = ioread32(base + USBHS_UGCTRL_REG); + val &= ~USBHS_UGCTRL_PLLRESET; + iowrite32(val, base + USBHS_UGCTRL_REG); + + val = ioread16(base + USBHS_LPSTS_REG); + val |= USBHS_LPSTS_SUSPM; + iowrite16(val, base + USBHS_LPSTS_REG); + + for (i = 0; i < 20; i++) { + val = ioread32(base + USBHS_UGSTS_REG); + if ((val & USBHS_UGSTS_LOCK) == USBHS_UGSTS_LOCK) { + val = ioread32(base + USBHS_UGCTRL_REG); + val |= USBHS_UGCTRL_CONNECT; + iowrite32(val, base + USBHS_UGCTRL_REG); + return 0; + } + udelay(1); + } + + /* Timed out waiting for the PLL lock */ + return -ETIMEDOUT; +} + +/* Disable USBHS internal phy */ +static int __rcar_gen2_usbhs_phy_disable(void __iomem *base) +{ + u32 val; + + /* USBHS PHY power off */ + val = ioread32(base + USBHS_UGCTRL_REG); + val &= ~USBHS_UGCTRL_CONNECT; +
[Trivial PATCH] usb: Remove unnecessary semicolons
These aren't necessary after switch and if blocks. Signed-off-by: Joe Perches --- drivers/usb/core/hcd.c | 2 +- drivers/usb/core/hub.c | 2 +- drivers/usb/dwc3/ep0.c | 6 +++--- drivers/usb/gadget/composite.c | 2 +- drivers/usb/gadget/dummy_hcd.c | 6 +++--- drivers/usb/gadget/goku_udc.c | 2 +- drivers/usb/gadget/net2280.c| 4 ++-- drivers/usb/gadget/rndis.c | 2 +- drivers/usb/gadget/tcm_usb_gadget.c | 4 ++-- drivers/usb/host/ehci-dbg.c | 2 +- drivers/usb/host/fotg210-hcd.c | 2 +- drivers/usb/host/fusbh200-hcd.c | 2 +- drivers/usb/host/isp1362-hcd.c | 2 +- drivers/usb/host/ohci-dbg.c | 2 +- drivers/usb/host/sl811-hcd.c| 4 ++-- drivers/usb/host/uhci-pci.c | 2 +- drivers/usb/host/whci/hcd.c | 4 ++-- drivers/usb/musb/musb_core.c| 2 +- drivers/usb/musb/musb_dsps.c| 2 +- drivers/usb/musb/musb_gadget.c | 2 +- drivers/usb/musb/musb_host.c| 2 +- drivers/usb/phy/phy-twl4030-usb.c | 2 +- drivers/usb/phy/phy-ulpi-viewport.c | 2 +- drivers/usb/wusbcore/cbaf.c | 4 ++-- drivers/usb/wusbcore/devconnect.c | 2 +- drivers/usb/wusbcore/wa-xfer.c | 4 ++-- 26 files changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index d6a8d23..b915cac 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1813,7 +1813,7 @@ rescan: s = "-intr"; break; default: s = "-iso"; break; - }; + } s; })); usb_put_urb (urb); diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index e6b682c..c95e2fc 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -433,7 +433,7 @@ static void set_port_led( case HUB_LED_OFF: s = "off"; break; case HUB_LED_AUTO: s = "auto"; break; default: s = "??"; break; - }; s; }), + } s; }), status); } diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 7fa93f4..95f7649 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -352,7 +352,7 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc, break; default: return -EINVAL; - }; + } response_pkt = (__le16 *) dwc->setup_buf; *response_pkt = cpu_to_le16(usb_status); @@ -470,7 +470,7 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc, default: return -EINVAL; - }; + } return 0; } @@ -709,7 +709,7 @@ static int dwc3_ep0_std_request(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) dev_vdbg(dwc->dev, "Forwarding to gadget driver\n"); ret = dwc3_ep0_delegate_req(dwc, ctrl); break; - }; + } return ret; } diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index d4f0f33..3e7ae70 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -354,7 +354,7 @@ static u8 encode_bMaxPower(enum usb_device_speed speed, return DIV_ROUND_UP(val, 8); default: return DIV_ROUND_UP(val, 2); - }; + } } static int config_buf(struct usb_configuration *config, diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index b8a2376..8f4dae3 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -544,7 +544,7 @@ static int dummy_enable(struct usb_ep *_ep, default: val = "ctrl"; break; -}; val; }), +} val; }), max, ep->stream_en ? "enabled" : "disabled"); /* at this point real hardware should be NAKing transfers @@ -2271,7 +2271,7 @@ static inline ssize_t show_urb(char *buf, size_t size, struct urb *urb) default: s = "?"; break; -}; s; }), +} s; }), ep, ep ? (usb_pipein(urb->pipe) ? "in" : "out") : "", ({ char *s; \ switch (usb_pipetype(urb->pipe)) { \ @@ -2287,7 +2287,7 @@ static inline ssize_t show_urb(char *buf, size_t size, struct urb *urb) default: \ s = "-iso"; \ break; \ - }; s; }), + } s; }), urb->actual_length, urb->transfer_buffer_length); } diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index c64deb9..ef7ba00 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb
[PATCH] xhci: correct the usage of USB_CTRL_SET_TIMEOUT
From: xiao jin Date: Wed, 9 Oct 2013 09:09:46 +0800 Subject: [PATCH] xhci: correct the usage of USB_CTRL_SET_TIMEOUT The usage of USB_CTRL_SET_TIMEOUT is incorrect. The definition of USB_CTRL_SET_TIMEOUT is 5000ms. The input timeout to wait_for_completion_interruptible_timeout is jiffies. That makes the timeout be longer than what we want, such as 50s in some platform. The patch is to convert USB_CTRL_SET_TIMEOUT to jiffies as command completion event timeout. Signed-off-by: xiao jin --- drivers/usb/host/xhci-hub.c |2 +- drivers/usb/host/xhci.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 1d35459..78cf294 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -295,7 +295,7 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend) /* Wait for last stop endpoint command to finish */ timeleft = wait_for_completion_interruptible_timeout( cmd->completion, - USB_CTRL_SET_TIMEOUT); + msecs_to_jiffies(USB_CTRL_SET_TIMEOUT)); if (timeleft <= 0) { xhci_warn(xhci, "%s while waiting for stop endpoint command\n", timeleft == 0 ? "Timeout" : "Signal"); diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 9478caa..f9ebc72 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -3486,7 +3486,7 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) /* Wait for the Reset Device command to finish */ timeleft = wait_for_completion_interruptible_timeout( reset_device_cmd->completion, - USB_CTRL_SET_TIMEOUT); + msecs_to_jiffies(USB_CTRL_SET_TIMEOUT)); if (timeleft <= 0) { xhci_warn(xhci, "%s while waiting for reset device command\n", timeleft == 0 ? "Timeout" : "Signal"); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] xhci-hub.c: handle command_trb that may be link TRB
From: xiao jin Date: Wed, 9 Oct 2013 09:38:45 +0800 Subject: [PATCH] xhci-hub.c: handle command_trb that may be link TRB When xhci stop device, it's possible cmd_ring enqueue point to link TRB after queue the last but one stop endpoint. We must handle the command_trb point to the next segment trb. Otherwise xhci stop devie will timeout because command_trb can't match with cmd_ring dequeue. The patch is to let command_trb point to the next segment trb if cmd_ring enqueue point to link TRB. Signed-off-by: xiao jin --- drivers/usb/host/xhci-hub.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 1d35459..4872640 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -287,6 +287,13 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend) xhci_queue_stop_endpoint(xhci, slot_id, i, suspend); } cmd->command_trb = xhci->cmd_ring->enqueue; + /* Enqueue pointer can be left pointing to the link TRB, +* we must handle that +*/ + if (TRB_TYPE_LINK_LE32(cmd->command_trb->link.control)) + cmd->command_trb = + xhci->cmd_ring->enq_seg->next->trbs; + list_add_tail(&cmd->cmd_list, &virt_dev->cmd_list); xhci_queue_stop_endpoint(xhci, slot_id, 0, suspend); xhci_ring_cmd_db(xhci); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/3] Add USBHS support to Lager (take 2)
On Tue, Oct 08, 2013 at 11:43:24PM +0400, Valentine Barshak wrote: > This patch set adds internal USB PHY support to RCAR Gen2 SoC, and > also enables USBHS for the Lager board. It has been updated, based > on the comments to the previous version. > > The patches apply fine to the renesas-devel-20131008 tag of the renesas.git. > The first patch also applies fine to the usb.git at kernel.org. > It adds RCAR Gen2 phy driver which is used to configure the shared USB > channels 0/2 and to control USBHS internal PHY. > All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host) > should acquire the USB phy first to set proper channel configuration. > > The other two patches add USBHS support to Lager board, which requires > RCAR Gen2 phy driver. > > Changes from previous version: > * use-counting and clock handling done in the usb_phy_init/shutdown > callbacks only; > * a minor typo in the comments fixed; > * phy clean up moved to __rcar_gen2_usb_phy_shutdown function; > * usb_phy_init/shutdown called from usbhs_power_ctrl callback > to allow renesas_usbhs driver disable USB PHY completely > when it is not needed. Hi Morimoto-san, I could you review this revised series? My assumption is that in the current form the first patch will go through the USB tree while the latter patches will subsequently go through (my) renesas tree. > Valentine Barshak (3): > usb: phy: Add RCAR Gen2 USB phy > arm: shmobile: r8a7790: Add USBHS clock support > arm: shmobile: lager: Add USBHS support > > arch/arm/mach-shmobile/board-lager.c| 106 ++ > arch/arm/mach-shmobile/clock-r8a7790.c | 4 + > drivers/usb/phy/Kconfig | 13 ++ > drivers/usb/phy/Makefile| 1 + > drivers/usb/phy/phy-rcar-gen2-usb.c | 255 > > include/linux/platform_data/usb-rcar-gen2-phy.h | 22 ++ > 6 files changed, 401 insertions(+) > create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c > create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h > > -- > 1.8.3.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sh" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: XHCI: Handling of Zero length packet in data stage
Hi Sarah, Alan, I'm taking over reporting of this issue for Hemant while he is out on vacation. On Mon, Oct 07, 2013 at 05:44:56PM -0400, Alan Stern wrote: > On Mon, 7 Oct 2013, Sarah Sharp wrote: > > What should urb->actual_length be set to instead? The device sent > > zero bytes in the data stage and urb->transfer_buffer_length *is* > > zero, so it > > No, urb->transfer_buffer_length > 0. That's the point. > > If I understand the OP correctly, he is saying that a 0-length > response to (for example) an 8-byte control-in transfer will end up > with urb->actual_length set to 8 rather than 0. That's correct. In our case we are not setting URB_SHORT_NOT_OK, and the URB's transfer_buffer_length is non-zero, so the data stage TRB does get enqueued. The device responds with a zero-length data packet but that is resulting in the URB incorrectly getting its actual_length set to transfer_buffer_length, instead of 0 as we would expect. This problem is not seen when connected to an EHCI controller. On Tue, Oct 08, 2013 at 10:19:11AM -0400, Alan Stern wrote: > On Mon, 7 Oct 2013, Sarah Sharp wrote: > > > > i am using 3.10 kernel. Also i looked at tip i see same implementation for > > > process_ctrl_td() > > > > > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/host/xhci-ring.c > > > > Yeah, the implementation has always been this way. I've known since the > > beginning of writing the xHCI driver that it needs to handle zero-length > > data phases, but hadn't had ever had a report that it was required by a > > device under Linux. > > This code, near the end of process_ctrl_td(), looks a little strange: > > /* >* Did we transfer any data, despite the errors that might have >* happened? I.e. did we get past the setup stage? >*/ > if (event_trb != ep_ring->dequeue) { > /* The event was for the status stage */ > if (event_trb == td->last_trb) { > if (td->urb->actual_length != 0) { > /* Don't overwrite a previously set error code >*/ > if ((*status == -EINPROGRESS || *status == 0) && > (td->urb->transfer_flags >& URB_SHORT_NOT_OK)) > /* Did we already see a short data >* stage? */ > *status = -EREMOTEIO; > > If you already saw a short data stage, why isn't the status already set > to -EREMOTEIO? > > Also what's the reason for the test "td->urb->actual_length != 0"? > What does this have to do with getting a short data stage? Are you > assuming that at this point, actual_length will be nonzero if and only > if there was a short data stage? > > } else { > td->urb->actual_length = > td->urb->transfer_buffer_length; > } > > What's the purpose of this clause? > > It looks like the driver is confusing "actual_length == 0" with > "actual_length was never set". What if actual_length _was_ previously > set, but it was set to 0? Alan, your analysis is consistent with our findings as well. We are seeing that if actual_length got set to 0 in the data stage, then when the status stage is processed the above else clause ends up overwriting this value before handing back the URB. Thus the zero-length packet is incorrectly reported as a successful transfer of transfer_buffer_length. Here's a patch we came up with that seems to fix the immediate issue. However, I'm not sure if this has other side effects or not, e.g. if URB_SHORT_NOT_OK is set. Jack 8< diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 204110c..507a72d 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2056,6 +2056,8 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, /* Did we already see a short data * stage? */ *status = -EREMOTEIO; + } else if (td->zlp_data) { + td->zlp_data = false; } else { td->urb->actual_length = td->urb->transfer_buffer_length; @@ -2065,6 +2067,10 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, td->urb->actual_length = td->urb->transfer_buffer_length - EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)); + + if (td->urb->actual_length == 0) + td->zlp_data = true; +
Re: [PATCH 0/3] Add USBHS support to Lager (take 2)
Hi > This patch set adds internal USB PHY support to RCAR Gen2 SoC, and > also enables USBHS for the Lager board. It has been updated, based > on the comments to the previous version. > > The patches apply fine to the renesas-devel-20131008 tag of the renesas.git. > The first patch also applies fine to the usb.git at kernel.org. > It adds RCAR Gen2 phy driver which is used to configure the shared USB > channels 0/2 and to control USBHS internal PHY. > All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host) > should acquire the USB phy first to set proper channel configuration. > > The other two patches add USBHS support to Lager board, which requires > RCAR Gen2 phy driver. > > Changes from previous version: > * use-counting and clock handling done in the usb_phy_init/shutdown > callbacks only; > * a minor typo in the comments fixed; > * phy clean up moved to __rcar_gen2_usb_phy_shutdown function; > * usb_phy_init/shutdown called from usbhs_power_ctrl callback > to allow renesas_usbhs driver disable USB PHY completely > when it is not needed. > > Valentine Barshak (3): > usb: phy: Add RCAR Gen2 USB phy > arm: shmobile: r8a7790: Add USBHS clock support > arm: shmobile: lager: Add USBHS support > > arch/arm/mach-shmobile/board-lager.c| 106 ++ > arch/arm/mach-shmobile/clock-r8a7790.c | 4 + > drivers/usb/phy/Kconfig | 13 ++ > drivers/usb/phy/Makefile| 1 + > drivers/usb/phy/phy-rcar-gen2-usb.c | 255 > > include/linux/platform_data/usb-rcar-gen2-phy.h | 22 ++ > 6 files changed, 401 insertions(+) > create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c > create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h For all patches Acked-by: Kuninori Morimoto # I think we can implement usb_phy_xxx() method # in renesas_usbhs driver someday. Best regards --- Kuninori Morimoto -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/3] Add USBHS support to Lager (take 2)
On Tue, Oct 08, 2013 at 07:09:36PM -0700, Kuninori Morimoto wrote: > > Hi > > > This patch set adds internal USB PHY support to RCAR Gen2 SoC, and > > also enables USBHS for the Lager board. It has been updated, based > > on the comments to the previous version. > > > > The patches apply fine to the renesas-devel-20131008 tag of the renesas.git. > > The first patch also applies fine to the usb.git at kernel.org. > > It adds RCAR Gen2 phy driver which is used to configure the shared USB > > channels 0/2 and to control USBHS internal PHY. > > All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host) > > should acquire the USB phy first to set proper channel configuration. > > > > The other two patches add USBHS support to Lager board, which requires > > RCAR Gen2 phy driver. > > > > Changes from previous version: > > * use-counting and clock handling done in the usb_phy_init/shutdown > > callbacks only; > > * a minor typo in the comments fixed; > > * phy clean up moved to __rcar_gen2_usb_phy_shutdown function; > > * usb_phy_init/shutdown called from usbhs_power_ctrl callback > > to allow renesas_usbhs driver disable USB PHY completely > > when it is not needed. > > > > Valentine Barshak (3): > > usb: phy: Add RCAR Gen2 USB phy > > arm: shmobile: r8a7790: Add USBHS clock support > > arm: shmobile: lager: Add USBHS support > > > > arch/arm/mach-shmobile/board-lager.c| 106 ++ > > arch/arm/mach-shmobile/clock-r8a7790.c | 4 + > > drivers/usb/phy/Kconfig | 13 ++ > > drivers/usb/phy/Makefile| 1 + > > drivers/usb/phy/phy-rcar-gen2-usb.c | 255 > > > > include/linux/platform_data/usb-rcar-gen2-phy.h | 22 ++ > > 6 files changed, 401 insertions(+) > > create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c > > create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h > > For all patches > > Acked-by: Kuninori Morimoto > > # I think we can implement usb_phy_xxx() method > # in renesas_usbhs driver someday. Hi Felipe, could you consider taking the first patch of this series? And if so, could you provide a branch that I can use as a base for the other changes in the series? Thanks -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] ARM: omap: edma: add suspend suspend/resume hooks
On 10/01/2013 10:04 AM, Daniel Mack wrote: > This patch makes the edma driver resume correctly after suspend. Tested > on an AM33xx platform with cyclic audio streams. > > The code was shamelessly taken from an ancient BSP tree. > > Signed-off-by: Daniel Mack > --- > arch/arm/common/edma.c | 133 > + > 1 file changed, 133 insertions(+) > > diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c > index 2a72169..d787f14 100644 > --- a/arch/arm/common/edma.c > +++ b/arch/arm/common/edma.c > @@ -258,6 +258,20 @@ struct edma { > void *data); > void *data; > } intr_data[EDMA_MAX_DMACH]; > + > + struct { > + struct edmacc_param *prm_set; > + unsigned int *ch_map; /* 64 registers */ > + unsigned int *que_num; /* 8 registers */ This is OK to save. > + unsigned int sh_esr; > + unsigned int sh_esrh; > + unsigned int sh_eesr; > + unsigned int sh_eesrh; > + unsigned int sh_iesr; > + unsigned int sh_iesrh; Are all these really necessary? esr and eer- No one should really be setting the esr and should not depend on it when going to a low power state. I wouldn't expect any driver to suspend between edma_start and edma_stop. In DMA Engine, this would correspond to the driver getting a successful callback. Before suspend, drivers using DMA should anyway be done with using the channel before they can goto suspend, correct me if I'm wrong. So this seems unnecessary to do. Only thing that makes sense to me to save here is the iesr registers. > + unsigned int que_tc_map; > + unsigned int que_pri; This is OK to save. > + } context; > }; > > static struct edma *edma_cc[EDMA_MAX_CC]; > @@ -1655,6 +1669,16 @@ static int edma_probe(struct platform_device *pdev) > memcpy_toio(edmacc_regs_base[j] + PARM_OFFSET(i), > &dummy_paramset, PARM_SIZE); > > + /* resume context */ > + edma_cc[j]->context.prm_set = > + kzalloc((sizeof(struct edmacc_param) * > + edma_cc[j]->num_slots), GFP_KERNEL); Why should you back-up PaRAM set? I feel this is not necessary. PaRAM set will be setup again for the transfer after the resume, and there shouldn't be any pending transfers before the suspend. Looks like in your audio driver you need to make sure any pending DMA transfers are completed before suspending (unless you're already doing so). > + edma_cc[j]->context.ch_map = > + kzalloc((sizeof(unsigned int) * > + edma_cc[j]->num_channels), GFP_KERNEL); > + edma_cc[j]->context.que_num = > + kzalloc((sizeof(unsigned int) * 8), GFP_KERNEL); Can these allocations be moved to the suspend path? For systems that don't suspend/resume even once, I feel we shouldn't allocate memory that we don't use. These allocations are better to do there. -Joel -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] ARM: omap: edma: add suspend suspend/resume hooks
On Wednesday 09 October 2013 09:58 AM, Joel Fernandes wrote: > On 10/01/2013 10:04 AM, Daniel Mack wrote: >> This patch makes the edma driver resume correctly after suspend. Tested >> on an AM33xx platform with cyclic audio streams. >> >> The code was shamelessly taken from an ancient BSP tree. >> >> Signed-off-by: Daniel Mack >> --- >> arch/arm/common/edma.c | 133 >> + >> 1 file changed, 133 insertions(+) >> ..snip.. ..snip.. > >> +edma_cc[j]->context.ch_map = >> +kzalloc((sizeof(unsigned int) * >> + edma_cc[j]->num_channels), GFP_KERNEL); >> +edma_cc[j]->context.que_num = >> +kzalloc((sizeof(unsigned int) * 8), GFP_KERNEL); > > Can these allocations be moved to the suspend path? For systems that don't > suspend/resume even once, I feel we shouldn't allocate memory that we don't > use. > These allocations are better to do there. AFAIK, Suspend/resume should be quick. Allocating and deallocating on every iterating would be useless and time consuming. Also this task is one time and quick. Are there any systems (Linux based for now) which doesn't suspend/resume? I believe the probability is very less. regards Gururaja > > -Joel > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] ARM: omap: edma: add suspend suspend/resume hooks
Some temporary issues with my mua so forgive any artifacts in this email. On Oct 9, 2013, at 12:14 AM, "Hebbar, Gururaja" wrote: > On Wednesday 09 October 2013 09:58 AM, Joel Fernandes wrote: >> On 10/01/2013 10:04 AM, Daniel Mack wrote: >>> This patch makes the edma driver resume correctly after suspend. Tested >>> on an AM33xx platform with cyclic audio streams. >>> >>> The code was shamelessly taken from an ancient BSP tree. >>> >>> Signed-off-by: Daniel Mack >>> --- >>> arch/arm/common/edma.c | 133 >>> + >>> 1 file changed, 133 insertions(+) > > ..snip.. > ..snip.. >> >>> +edma_cc[j]->context.ch_map = >>> +kzalloc((sizeof(unsigned int) * >>> + edma_cc[j]->num_channels), GFP_KERNEL); >>> +edma_cc[j]->context.que_num = >>> +kzalloc((sizeof(unsigned int) * 8), GFP_KERNEL); >> >> Can these allocations be moved to the suspend path? For systems that don't >> suspend/resume even once, I feel we shouldn't allocate memory that we don't >> use. >> These allocations are better to do there. > > AFAIK, Suspend/resume should be quick. Allocating and deallocating on > every iterating would be useless and time consuming. Nobody said allocate and deallocate on every iteration. Allocate once during the first suspend call and then don't have to allocate on subsequent calls. As for suspend resume being quick, that argument can flipped the other way too, booting should be quick which is far more frequent than suspend/resume. Apart from the fact that we're not allocating useless memory we would never use. > > Also this task is one time and quick. Exactly. > > Are there any systems (Linux based for now) which doesn't > suspend/resume? I believe the probability is very less. Nobody talked about suspend/resume not being supported in Linux so not sure what your argument is here. regards, -Joel > > regards > Gururaja > >> >> -Joel >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-omap" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] ARM: omap: edma: add suspend suspend/resume hooks
On Wednesday 09 October 2013 11:33 AM, Fernandes, Joel wrote: > Some temporary issues with my mua so forgive any artifacts in this email. > > On Oct 9, 2013, at 12:14 AM, "Hebbar, Gururaja" > wrote: > >> On Wednesday 09 October 2013 09:58 AM, Joel Fernandes wrote: >>> On 10/01/2013 10:04 AM, Daniel Mack wrote: This patch makes the edma driver resume correctly after suspend. Tested on an AM33xx platform with cyclic audio streams. The code was shamelessly taken from an ancient BSP tree. Signed-off-by: Daniel Mack --- arch/arm/common/edma.c | 133 + 1 file changed, 133 insertions(+) >> >> ..snip.. >> ..snip.. >>> +edma_cc[j]->context.ch_map = +kzalloc((sizeof(unsigned int) * + edma_cc[j]->num_channels), GFP_KERNEL); +edma_cc[j]->context.que_num = +kzalloc((sizeof(unsigned int) * 8), GFP_KERNEL); >>> >>> Can these allocations be moved to the suspend path? For systems that don't >>> suspend/resume even once, I feel we shouldn't allocate memory that we don't >>> use. >>> These allocations are better to do there. >> >> AFAIK, Suspend/resume should be quick. Allocating and deallocating on >> every iterating would be useless and time consuming. > > Nobody said allocate and deallocate on every iteration. Allocate once during > the first suspend call and then don't have to allocate on subsequent calls. I couldn't find any code which allocates parameters inside suspend. Could you show me some code which does this? > > As for suspend resume being quick, that argument can flipped the other way > too, booting should be quick which is far more frequent than suspend/resume. > Apart from the fact that we're not allocating useless memory we would never > use. > >> >> Also this task is one time and quick. > > Exactly. i was referring to allocating in probe call.. > >> >> Are there any systems (Linux based for now) which doesn't >> suspend/resume? I believe the probability is very less. > > Nobody talked about suspend/resume not being supported in Linux so not sure > what your argument is here. I meant linux systems which doesn't go to suspend and resume. Not suspend/resume feature. Also, I was referring to your 1st comment "... For systems that don't suspend/resume even once, " regards Gururaja > > regards, > > -Joel > >> >> regards >> Gururaja >> >>> >>> -Joel >>> >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in >>> the body of a message to majord...@vger.kernel.org >>> More majordomo info at http://vger.kernel.org/majordomo-info.html >> -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] USB: gadget: s3c-hsotg: fix set_ep_maxpacket function
This patch fixes max packet size check in s3c_hsotg_set_ep_maxpacket() function. According USB specification, bits 10..0 of mps specifies maximum packet size, so there is bitwise AND between mps and 0x7ff value. Also added check if maxpacket isn't grater than 1024 which is maximum size od single USB transaction. In s3c_hsotg_ep_enable() function added s3c_hsotg_set_ep_maxpacket() call instead of setting ep.maxpacket value directly. Signed-off-by: Robert Baldyga Signed-off-by: Kyungmin Park --- drivers/usb/gadget/s3c-hsotg.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 5a15de0..139122a 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -1726,15 +1726,14 @@ static void s3c_hsotg_set_ep_maxpacket(struct s3c_hsotg *hsotg, mpsval = s3c_hsotg_ep0_mps(mps); if (mpsval > 3) goto bad_mps; + hs_ep->ep.maxpacket = mps; } else { - if (mps >= DxEPCTL_MPS_LIMIT+1) + mpsval = mps & DxEPCTL_MPS_MASK; + if (mpsval > 1024) goto bad_mps; - - mpsval = mps; + hs_ep->ep.maxpacket = mpsval; } - hs_ep->ep.maxpacket = mps; - /* * update both the in and out endpoint controldir_ registers, even * if one of the directions may not be in use. @@ -2614,7 +2613,7 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, epctrl |= DxEPCTL_SNAK; /* update the endpoint state */ - hs_ep->ep.maxpacket = mps; + s3c_hsotg_set_ep_maxpacket(hsotg, hs_ep->index, mps); /* default, set to non-periodic */ hs_ep->periodic = 0; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/3] dma: cppi41: more suspend/resume patches
* Daniel Mack | 2013-10-01 15:31:08 [+0200]: >Patch #1 restores more registers on resume time. > >Patch #2 is a cosmetic cleanup that emerged while digging through the >driver and gaining a basic idea of how it's implemented. Nothing fancy. I'm fine with those two. > >Patch #3, however, gives me headaches. I can't fully explain what's >going on, but I can tell for sure that if fixes a problem that I stared >on for many hours. I'm still trying to verify if it breaks something or not. So I haven't forgotten about this. Sebastian -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3] USB: gadget: s3c-hsotg: add isochronous transfers support
This patch adds isochronous transfer support. It adds few modifications: - Modify s3c_hsotg_epint() function. Some interrupts are ignored for isochronous endpoints, (e.g. INTknTXFEmpMsk) becouse isochronous request is always transfered in single transaction, which ends with XferCompl interrupt. - Add Odd/Even microframe toggle to allow data transfering in each microframe in s3c_hsotg_epint() function. - Fix s3c_hsotg_ep_enable() function by supporting isochronous endpoint type. Signed-off-by: Robert Baldyga Signed-off-by: Kyungmin Park --- Hello, This is third version of patch adding isochronous transfers support in s3c-hsotg driver. From last version I have separated one bugfix for s3c_hsotg_set_ep_maxpacket() function into another patch. I also have splitted modifications into two patches: this patch, adding isochronous support base, and the second patch adding support for multiple transfers per microframe, which will be sent soon. Best regards Robert Baldyga Samsung R&D Institute Poland Changelog: v3: - separated bugfix into another patch - moved additional functionality into another patch v2: https://lkml.org/lkml/2013/9/24/154 - moved bugfix affecting to the other features to separated patch - changed conditions order in request length checking in s3c_hsotg_start_req function, as Bartlomiej Zolnierkiewicz suggested - fixed typos v1: https://lkml.org/lkml/2013/9/23/72 - initial proposal drivers/usb/gadget/s3c-hsotg.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 139122a..e3ffbc0 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -83,9 +83,11 @@ struct s3c_hsotg_req; * @dir_in: Set to true if this endpoint is of the IN direction, which * means that it is sending data to the Host. * @index: The index for the endpoint registers. + * @interval - Interval for periodic endpoints * @name: The name array passed to the USB core. * @halted: Set if the endpoint has been halted. * @periodic: Set if this is a periodic ep, such as Interrupt + * @isochronous: Set if this is a isochronous ep * @sent_zlp: Set if we've sent a zero-length packet. * @total_data: The total number of data bytes done. * @fifo_size: The size of the FIFO (for periodic IN endpoints) @@ -121,9 +123,11 @@ struct s3c_hsotg_ep { unsigned char dir_in; unsigned char index; + unsigned char interval; unsigned inthalted:1; unsigned intperiodic:1; + unsigned intisochronous:1; unsigned intsent_zlp:1; charname[10]; @@ -1915,8 +1919,10 @@ static void s3c_hsotg_epint(struct s3c_hsotg *hsotg, unsigned int idx, u32 epctl_reg = dir_in ? DIEPCTL(idx) : DOEPCTL(idx); u32 epsiz_reg = dir_in ? DIEPTSIZ(idx) : DOEPTSIZ(idx); u32 ints; + u32 ctrl; ints = readl(hsotg->regs + epint_reg); + ctrl = readl(hsotg->regs + epctl_reg); /* Clear endpoint interrupts */ writel(ints, hsotg->regs + epint_reg); @@ -1925,6 +1931,14 @@ static void s3c_hsotg_epint(struct s3c_hsotg *hsotg, unsigned int idx, __func__, idx, dir_in ? "in" : "out", ints); if (ints & DxEPINT_XferCompl) { + if (hs_ep->isochronous && hs_ep->interval == 1) { + if (ctrl & DxEPCTL_EOFrNum) + ctrl |= DxEPCTL_SetEvenFr; + else + ctrl |= DxEPCTL_SetOddFr; + writel(ctrl, hsotg->regs + epctl_reg); + } + dev_dbg(hsotg->dev, "%s: XferCompl: DxEPCTL=0x%08x, DxEPTSIZ=%08x\n", __func__, readl(hsotg->regs + epctl_reg), @@ -1991,7 +2005,7 @@ static void s3c_hsotg_epint(struct s3c_hsotg *hsotg, unsigned int idx, if (ints & DxEPINT_Back2BackSetup) dev_dbg(hsotg->dev, "%s: B2BSetup/INEPNakEff\n", __func__); - if (dir_in) { + if (dir_in && !hs_ep->isochronous) { /* not sure if this is important, but we'll clear it anyway */ if (ints & DIEPMSK_INTknTXFEmpMsk) { dev_dbg(hsotg->dev, "%s: ep%d: INTknTXFEmpMsk\n", @@ -2616,14 +2630,19 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, s3c_hsotg_set_ep_maxpacket(hsotg, hs_ep->index, mps); /* default, set to non-periodic */ + hs_ep->isochronous = 0; hs_ep->periodic = 0; hs_ep->halted = 0; + hs_ep->interval = desc->bInterval; switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { case USB_ENDPOINT_XFER_ISOC: - dev_err(hsotg->dev, "no current ISOC support\n"); - ret = -EINVAL; - goto out; + epctrl |= DxEPCTL
[PATCH 1/1] usb: chipidea: udc: Fix spinlock recursion during bus reset
After configuration, the host also possible sends bus reset at any time, at such situation, it will trigger below spinlock recursion dump. This commit unlocks the spinlock before calling gadget's disconnect. BUG: spinlock recursion on CPU#0, swapper/0/0 lock: 0xbf128014, .magic: dead4ead, .owner: swapper/0/0, .owner_cpu: 0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-next-20130910+ #106 [<80014e20>] (unwind_backtrace+0x0/0xec) from [<80011a6c>] (show_stack+0x10/0x14) [<80011a6c>] (show_stack+0x10/0x14) from [<805c143c>] (dump_stack+0x94/0xbc) [<805c143c>] (dump_stack+0x94/0xbc) from [<80282cf8>] (do_raw_spin_lock+0x16c/0x18c) [<80282cf8>] (do_raw_spin_lock+0x16c/0x18c) from [<805c77e0>] (_raw_spin_lock_irqsave+0x50/0x5c) [<805c77e0>] (_raw_spin_lock_irqsave+0x50/0x5c) from [<803cff88>] (ep_disable+0x24/0x110) [<803cff88>] (ep_disable+0x24/0x110) from [<7f015d50>] (gserial_disconnect+0xa0/0x15c [u_serial]) [<7f015d50>] (gserial_disconnect+0xa0/0x15c [u_serial]) from [<7f01c06c>] (acm_disable+0xc/0x30 [usb_f_acm]) [<7f01c06c>] (acm_disable+0xc/0x30 [usb_f_acm]) from [<7f001478>] (reset_config.isra.10+0x34/0x5c [libcomposite]) [<7f001478>] (reset_config.isra.10+0x34/0x5c [libcomposite]) from [<7f0014d4>] (composite_disconnect+0x34/0x5c [libcomposite]) [<7f0014d4>] (composite_disconnect+0x34/0x5c [libcomposite]) from [<803d1024>] (udc_irq+0x770/0xce4) [<803d1024>] (udc_irq+0x770/0xce4) from [<803cdcc0>] (ci_irq+0x98/0x164) [<803cdcc0>] (ci_irq+0x98/0x164) from [<8007edfc>] (handle_irq_event_percpu+0x50/0x17c) [<8007edfc>] (handle_irq_event_percpu+0x50/0x17c) from [<8007ef64>] (handle_irq_event+0x3c/0x5c) [<8007ef64>] (handle_irq_event+0x3c/0x5c) from [<80081e98>] (handle_fasteoi_irq+0x98/0x168) [<80081e98>] (handle_fasteoi_irq+0x98/0x168) from [<8007e598>] (generic_handle_irq+0x28/0x3c) [<8007e598>] (generic_handle_irq+0x28/0x3c) from [<8000edf4>] (handle_IRQ+0x4c/0xb4) [<8000edf4>] (handle_IRQ+0x4c/0xb4) from [<800085bc>] (gic_handle_irq+0x28/0x5c) [<800085bc>] (gic_handle_irq+0x28/0x5c) from [<800125c0>] (__irq_svc+0x40/0x54) Exception stack(0x8083bf68 to 0x8083bfb0) bf60: 81533b80 00096234 8001d760 8088e12c bf80: 8083a000 8083a000 8084290c 805cb414 808428ac 8083a000 0001 8083bfb0 bfa0: 8000f138 8000f13c 6013 [<800125c0>] (__irq_svc+0x40/0x54) from [<8000f13c>] (arch_cpu_idle+0x30/0x3c) [<8000f13c>] (arch_cpu_idle+0x30/0x3c) from [<8005eb94>] (cpu_startup_entry+0xf4/0x148) [<8005eb94>] (cpu_startup_entry+0xf4/0x148) from [<807f1a2c>] (start_kernel+0x2c4/0x318) BUG: spinlock lockup suspected on CPU#0, swapper/0/0 lock: 0xbf128014, .magic: dead4ead, .owner: swapper/0/0, .owner_cpu: 0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-next-20130910+ #106 [<80014e20>] (unwind_backtrace+0x0/0xec) from [<80011a6c>] (show_stack+0x10/0x14) [<80011a6c>] (show_stack+0x10/0x14) from [<805c143c>] (dump_stack+0x94/0xbc) [<805c143c>] (dump_stack+0x94/0xbc) from [<80282c94>] (do_raw_spin_lock+0x108/0x18c) [<80282c94>] (do_raw_spin_lock+0x108/0x18c) from [<805c77e0>] (_raw_spin_lock_irqsave+0x50/0x5c) [<805c77e0>] (_raw_spin_lock_irqsave+0x50/0x5c) from [<803cff88>] (ep_disable+0x24/0x110) [<803cff88>] (ep_disable+0x24/0x110) from [<7f015d50>] (gserial_disconnect+0xa0/0x15c [u_serial]) [<7f015d50>] (gserial_disconnect+0xa0/0x15c [u_serial]) from [<7f01c06c>] (acm_disable+0xc/0x30 [usb_f_acm]) [<7f01c06c>] (acm_disable+0xc/0x30 [usb_f_acm]) from [<7f001478>] (reset_config.isra.10+0x34/0x5c [libcomposite]) [<7f001478>] (reset_config.isra.10+0x34/0x5c [libcomposite]) from [<7f0014d4>] (composite_disconnect+0x34/0x5c [libcomposite]) [<7f0014d4>] (composite_disconnect+0x34/0x5c [libcomposite]) from [<803d1024>] (udc_irq+0x770/0xce4) [<803d1024>] (udc_irq+0x770/0xce4) from [<803cdcc0>] (ci_irq+0x98/0x164) [<803cdcc0>] (ci_irq+0x98/0x164) from [<8007edfc>] (handle_irq_event_percpu+0x50/0x17c) [<8007edfc>] (handle_irq_event_percpu+0x50/0x17c) from [<8007ef64>] (handle_irq_event+0x3c/0x5c) [<8007ef64>] (handle_irq_event+0x3c/0x5c) from [<80081e98>] (handle_fasteoi_irq+0x98/0x168) [<80081e98>] (handle_fasteoi_irq+0x98/0x168) from [<8007e598>] (generic_handle_irq+0x28/0x3c) [<8007e598>] (generic_handle_irq+0x28/0x3c) from [<8000edf4>] (handle_IRQ+0x4c/0xb4) [<8000edf4>] (handle_IRQ+0x4c/0xb4) from [<800085bc>] (gic_handle_irq+0x28/0x5c) [<800085bc>] (gic_handle_irq+0x28/0x5c) from [<800125c0>] (__irq_svc+0x40/0x54) Exception stack(0x8083bf68 to 0x8083bfb0) bf60: 81533b80 00096234 8001d760 8088e12c bf80: 8083a000 8083a000 8084290c 805cb414 808428ac 8083a000 0001 8083bfb0 bfa0: 8000f138 8000f13c 6013 [<800125c0>] (__irq_svc+0x40/0x54) from [<8000f13c>] (arch_cpu_idle+0x30/0x3c) [<8000f13c>] (arch_cpu_idle+0x30/0x3c) from [<8005eb94>] (cpu_startup_entry+0xf4/0x148) [<8005eb94>] (cpu_startup_entry+0xf4/0x148) from [<807f1a2c>] (start_kernel+0x2c4/0x318) Signed-off-by: Peter Chen --- drivers/usb/
Re: [PATCH 1/1] usb: chipidea: udc: Fix spinlock recursion during bus reset
On Wed, Oct 09, 2013 at 02:39:52PM +0800, Peter Chen wrote: > After configuration, the host also possible sends bus reset > at any time, at such situation, it will trigger below spinlock > recursion dump. This commit unlocks the spinlock before calling > gadget's disconnect. > > BUG: spinlock recursion on CPU#0, swapper/0/0 > lock: 0xbf128014, .magic: dead4ead, .owner: swapper/0/0, .owner_cpu: 0 > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-next-20130910+ #106 > [<80014e20>] (unwind_backtrace+0x0/0xec) from [<80011a6c>] > (show_stack+0x10/0x14) > [<80011a6c>] (show_stack+0x10/0x14) from [<805c143c>] (dump_stack+0x94/0xbc) > [<805c143c>] (dump_stack+0x94/0xbc) from [<80282cf8>] > (do_raw_spin_lock+0x16c/0x18c) > [<80282cf8>] (do_raw_spin_lock+0x16c/0x18c) from [<805c77e0>] > (_raw_spin_lock_irqsave+0x50/0x5c) > [<805c77e0>] (_raw_spin_lock_irqsave+0x50/0x5c) from [<803cff88>] > (ep_disable+0x24/0x110) > [<803cff88>] (ep_disable+0x24/0x110) from [<7f015d50>] > (gserial_disconnect+0xa0/0x15c [u_serial]) > [<7f015d50>] (gserial_disconnect+0xa0/0x15c [u_serial]) from [<7f01c06c>] > (acm_disable+0xc/0x30 [usb_f_acm]) > [<7f01c06c>] (acm_disable+0xc/0x30 [usb_f_acm]) from [<7f001478>] > (reset_config.isra.10+0x34/0x5c [libcomposite]) > [<7f001478>] (reset_config.isra.10+0x34/0x5c [libcomposite]) from > [<7f0014d4>] (composite_disconnect+0x34/0x5c [libcomposite]) > [<7f0014d4>] (composite_disconnect+0x34/0x5c [libcomposite]) from > [<803d1024>] (udc_irq+0x770/0xce4) > [<803d1024>] (udc_irq+0x770/0xce4) from [<803cdcc0>] (ci_irq+0x98/0x164) > [<803cdcc0>] (ci_irq+0x98/0x164) from [<8007edfc>] > (handle_irq_event_percpu+0x50/0x17c) > [<8007edfc>] (handle_irq_event_percpu+0x50/0x17c) from [<8007ef64>] > (handle_irq_event+0x3c/0x5c) > [<8007ef64>] (handle_irq_event+0x3c/0x5c) from [<80081e98>] > (handle_fasteoi_irq+0x98/0x168) > [<80081e98>] (handle_fasteoi_irq+0x98/0x168) from [<8007e598>] > (generic_handle_irq+0x28/0x3c) > [<8007e598>] (generic_handle_irq+0x28/0x3c) from [<8000edf4>] > (handle_IRQ+0x4c/0xb4) > [<8000edf4>] (handle_IRQ+0x4c/0xb4) from [<800085bc>] > (gic_handle_irq+0x28/0x5c) > [<800085bc>] (gic_handle_irq+0x28/0x5c) from [<800125c0>] > (__irq_svc+0x40/0x54) > Exception stack(0x8083bf68 to 0x8083bfb0) > bf60: 81533b80 00096234 8001d760 8088e12c > bf80: 8083a000 8083a000 8084290c 805cb414 808428ac 8083a000 0001 8083bfb0 > bfa0: 8000f138 8000f13c 6013 > [<800125c0>] (__irq_svc+0x40/0x54) from [<8000f13c>] (arch_cpu_idle+0x30/0x3c) > [<8000f13c>] (arch_cpu_idle+0x30/0x3c) from [<8005eb94>] > (cpu_startup_entry+0xf4/0x148) > [<8005eb94>] (cpu_startup_entry+0xf4/0x148) from [<807f1a2c>] > (start_kernel+0x2c4/0x318) > BUG: spinlock lockup suspected on CPU#0, swapper/0/0 > lock: 0xbf128014, .magic: dead4ead, .owner: swapper/0/0, .owner_cpu: 0 > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-next-20130910+ #106 > [<80014e20>] (unwind_backtrace+0x0/0xec) from [<80011a6c>] > (show_stack+0x10/0x14) > [<80011a6c>] (show_stack+0x10/0x14) from [<805c143c>] (dump_stack+0x94/0xbc) > [<805c143c>] (dump_stack+0x94/0xbc) from [<80282c94>] > (do_raw_spin_lock+0x108/0x18c) > [<80282c94>] (do_raw_spin_lock+0x108/0x18c) from [<805c77e0>] > (_raw_spin_lock_irqsave+0x50/0x5c) > [<805c77e0>] (_raw_spin_lock_irqsave+0x50/0x5c) from [<803cff88>] > (ep_disable+0x24/0x110) > [<803cff88>] (ep_disable+0x24/0x110) from [<7f015d50>] > (gserial_disconnect+0xa0/0x15c [u_serial]) > [<7f015d50>] (gserial_disconnect+0xa0/0x15c [u_serial]) from [<7f01c06c>] > (acm_disable+0xc/0x30 [usb_f_acm]) > [<7f01c06c>] (acm_disable+0xc/0x30 [usb_f_acm]) from [<7f001478>] > (reset_config.isra.10+0x34/0x5c [libcomposite]) > [<7f001478>] (reset_config.isra.10+0x34/0x5c [libcomposite]) from > [<7f0014d4>] (composite_disconnect+0x34/0x5c [libcomposite]) > [<7f0014d4>] (composite_disconnect+0x34/0x5c [libcomposite]) from > [<803d1024>] (udc_irq+0x770/0xce4) > [<803d1024>] (udc_irq+0x770/0xce4) from [<803cdcc0>] (ci_irq+0x98/0x164) > [<803cdcc0>] (ci_irq+0x98/0x164) from [<8007edfc>] > (handle_irq_event_percpu+0x50/0x17c) > [<8007edfc>] (handle_irq_event_percpu+0x50/0x17c) from [<8007ef64>] > (handle_irq_event+0x3c/0x5c) > [<8007ef64>] (handle_irq_event+0x3c/0x5c) from [<80081e98>] > (handle_fasteoi_irq+0x98/0x168) > [<80081e98>] (handle_fasteoi_irq+0x98/0x168) from [<8007e598>] > (generic_handle_irq+0x28/0x3c) > [<8007e598>] (generic_handle_irq+0x28/0x3c) from [<8000edf4>] > (handle_IRQ+0x4c/0xb4) > [<8000edf4>] (handle_IRQ+0x4c/0xb4) from [<800085bc>] > (gic_handle_irq+0x28/0x5c) > [<800085bc>] (gic_handle_irq+0x28/0x5c) from [<800125c0>] > (__irq_svc+0x40/0x54) > Exception stack(0x8083bf68 to 0x8083bfb0) > bf60: 81533b80 00096234 8001d760 8088e12c > bf80: 8083a000 8083a000 8084290c 805cb414 808428ac 8083a000 0001 8083bfb0 > bfa0: 8000f138 8000f13c 6013 > [<800125c0>] (__irq_svc+0x40/0x54) from [<8000f13c>]
Re: [PATCH 1/1] usb: chipidea: udc: Fix calling spin_lock_irqsave at sleep context
On Tue, Oct 08, 2013 at 10:30:17AM +0800, Peter Chen wrote: > Fixing the below dump: > > root@freescale ~$ modprobe g_serial > g_serial gadget: Gadget Serial v2.4 > g_serial gadget: g_serial ready > BUG: sleeping function called from invalid context at > /home/b29397/work/projects/upstream/usb/usb/drivers/base/power/runtime.c:952 > in_atomic(): 1, irqs_disabled(): 128, pid: 805, name: modprobe > 2 locks held by modprobe/805: > #0: (udc_lock){+.+.+.}, at: [<7f000a74>] usb_gadget_probe_driver+0x44/0xb4 > [udc_core] > #1: (&(&ci->lock)->rlock){..}, at: [<7f033488>] ci_udc_start+0x94/0x110 > [ci_hdrc] > irq event stamp: 3878 > hardirqs last enabled at (3877): [<806b6720>] > _raw_spin_unlock_irqrestore+0x40/0x6c > hardirqs last disabled at (3878): [<806b6474>] > _raw_spin_lock_irqsave+0x2c/0xa8 > softirqs last enabled at (3872): [<8002ec0c>] __do_softirq+0x1c8/0x2e8 > softirqs last disabled at (3857): [<8002f180>] irq_exit+0xbc/0x110 > CPU: 0 PID: 805 Comm: modprobe Not tainted 3.11.0-next-20130910+ #85 > [<80016b94>] (unwind_backtrace+0x0/0xf8) from [<80012e0c>] > (show_stack+0x20/0x24) > [<80012e0c>] (show_stack+0x20/0x24) from [<806af554>] (dump_stack+0x9c/0xc4) > [<806af554>] (dump_stack+0x9c/0xc4) from [<8005940c>] > (__might_sleep+0xf4/0x134) > [<8005940c>] (__might_sleep+0xf4/0x134) from [<803a04a4>] > (__pm_runtime_resume+0x94/0xa0) > [<803a04a4>] (__pm_runtime_resume+0x94/0xa0) from [<7f0334a4>] > (ci_udc_start+0xb0/0x110 [ci_hdrc]) > [<7f0334a4>] (ci_udc_start+0xb0/0x110 [ci_hdrc]) from [<7f0009b4>] > (udc_bind_to_driver+0x5c/0xd8 [udc_core]) > [<7f0009b4>] (udc_bind_to_driver+0x5c/0xd8 [udc_core]) from [<7f000ab0>] > (usb_gadget_probe_driver+0x80/0xb4 [udc_core]) > [<7f000ab0>] (usb_gadget_probe_driver+0x80/0xb4 [udc_core]) from [<7f008618>] > (usb_composite_probe+0xac/0xd8 [libcomposite]) > [<7f008618>] (usb_composite_probe+0xac/0xd8 [libcomposite]) from [<7f04b168>] > (init+0x8c/0xb4 [g_serial]) > [<7f04b168>] (init+0x8c/0xb4 [g_serial]) from [<800088e8>] > (do_one_initcall+0x108/0x16c) > [<800088e8>] (do_one_initcall+0x108/0x16c) from [<8008e518>] > (load_module+0x1b00/0x20a4) > [<8008e518>] (load_module+0x1b00/0x20a4) from [<8008eba8>] > (SyS_init_module+0xec/0x100) > [<8008eba8>] (SyS_init_module+0xec/0x100) from [<8000ec40>] > (ret_fast_syscall+0x0/0x48) > > Signed-off-by: Peter Chen Is this seen in 3.12-rc or just on top of your current patchset, so it can wait for the 3.13-rc1 merge? thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html