Re: [PATCH] usb: echi-hcd: Add ehci_setup check before echi_shutdown

2016-05-30 Thread Pramod Gurav
On 19 May 2016 at 15:42, Srinivas Kandagatla
<srinivas.kandaga...@linaro.org> wrote:



> Fixes 4bb3cad7125b ("usb: host: ehci-msm: Register usb shutdown function")
> Signed-off-by: Srinivas Kandagatla <srinivas.kandaga...@linaro.org>

Was seeing this crash while doing a reboot on db410c which is fixed
with this patch:

Tested-by: Pramod Gurav <pramod.gu...@linaro.org>
--
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] usb: host: ehci-msm: Conditionally call ehci suspend/resume

2016-05-26 Thread Pramod Gurav
On 21 May 2016 at 03:05, Andy Gross <andy.gr...@linaro.org> wrote:
> This patch fixes a suspend/resume issue where the driver is blindly
> calling ehci_suspend/resume functions when the ehci hasn't been setup.
> This results in a crash during suspend/resume operations.
>
> Signed-off-by: Andy Gross <andy.gr...@linaro.org>

Fixes below crash while doing a system suspend:

root@linaro-alip:~# echo freeze > /sys/power/state
[   22.348960] PM: Syncing filesystems ... done.
[   22.387778] Freezing user space processes ... (elapsed 0.001 seconds) done.
[   22.393614] Freezing remaining freezable tasks ... (elapsed 0.001
seconds) done.
[   22.512736] mmc0: Reset 0x1 never completed.
[   22.514296] Unable to handle kernel NULL pointer dereference at
virtual address 04e8
[   22.516068] pgd = 80003817d000
[   22.524161] [04e8] *pgd=b817e003,
*pud=b817f003, *pmd=
[   22.535414] Internal error: Oops: 9606 [#1] PREEMPT SMP
[   22.535680] Modules linked in:
[   22.544183] CPU: 3 PID: 1499 Comm: bash Not tainted 4.6.0+ #65
[   22.544275] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
[   22.550006] task: 800039abd780 ti: 80003928c000 task.ti:
80003928c000
[   22.556870] PC is at ehci_suspend+0x34/0xe4
[   22.564240] LR is at ehci_msm_pm_suspend+0x2c/0x34
[   22.568232] pc : [] lr : []
pstate: a0000145

Tested-by: Pramod Gurav <pramod.gu...@linaro.org>

> ---
>  drivers/usb/host/ehci-msm.c | 14 --
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
Regards,
Pramod
--
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: phy: msm: Fix Sparse warning

2014-09-29 Thread Pramod Gurav
This change fixes below sparse warning:
drivers/usb/phy/phy-msm-usb.c:1397:30:
warning: symbol 'msm_otg_mode_fops' was not declared.Should it be static?

Cc: Srinivas Kandagatla srinivas.kandaga...@linaro.org
Cc: Felipe Balbi ba...@ti.com
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Cc: linux-usb@vger.kernel.org
Signed-off-by: Pramod Gurav pramod.gu...@smartplayin.com
---
 drivers/usb/phy/phy-msm-usb.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 4bc3fd7..f663f32 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1394,7 +1394,7 @@ out:
return status;
 }
 
-const struct file_operations msm_otg_mode_fops = {
+static const struct file_operations msm_otg_mode_fops = {
.open = msm_otg_mode_open,
.read = seq_read,
.write = msm_otg_mode_write,
-- 
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 v9 2/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver

2014-09-12 Thread Pramod Gurav
Hi Felipe,

On 13-09-2014 01:50 AM, Felipe Balbi wrote:
 On Sat, Sep 13, 2014 at 01:44:25AM +0530, Pramod Gurav wrote:
 Andy,
 Couple of minor comments.

 On Sat, Sep 13, 2014 at 12:58 AM, Andy Gross agr...@codeaurora.org wrote:

 From: Ivan T. Ivanov iiva...@mm-sol.com

 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 iiva...@mm-sol.com
 Signed-off-by: Andy Gross agr...@codeaurora.org
 ---
  drivers/usb/dwc3/Kconfig |8 +++
  drivers/usb/dwc3/Makefile|1 +
  drivers/usb/dwc3/dwc3-qcom.c |  131
 ++
  3 files changed, 140 insertions(+)
  create mode 100644 drivers/usb/dwc3/dwc3-qcom.c


 ..


 +#include linux/platform_device.h
 +
 +struct dwc3_qcom {
 +   struct device   *dev;
 +

 Extra new line here.
 
 that's not an issue however.
 
 +   struct clk  *core_clk;
 +   struct clk  *iface_clk;
 +   struct clk  *sleep_clk;
 +};
 +
 +static int dwc3_qcom_probe(struct platform_device *pdev)
 +{
 +   struct device_node *node = pdev-dev.of_node;
 +   struct dwc3_qcom *qdwc;
 +   int ret = 0;

 Initialization not required.
 
 I'll fix this one as I'm already applying this patch.
 
 +
 +   qdwc = devm_kzalloc(pdev-dev, sizeof(*qdwc), GFP_KERNEL);
 +   if (!qdwc)
 +   return -ENOMEM;
 +
 +   platform_set_drvdata(pdev, qdwc);
 +
 +   qdwc-dev = pdev-dev;
 +
 +   qdwc-core_clk = devm_clk_get(qdwc-dev, core);
 +   if (IS_ERR(qdwc-core_clk)) {
 +   dev_err(qdwc-dev, failed to get core clock\n);
 +   return PTR_ERR(qdwc-core_clk);
 +   }
 +
 +   qdwc-iface_clk = devm_clk_get(qdwc-dev, iface);
 +   if (IS_ERR(qdwc-iface_clk)) {
 +   dev_dbg(qdwc-dev, failed to get optional iface clock\n);
 +   qdwc-iface_clk = NULL;
 +   }
 +
 +   qdwc-sleep_clk = devm_clk_get(qdwc-dev, sleep);
 +   if (IS_ERR(qdwc-sleep_clk)) {
 +   dev_dbg(qdwc-dev, failed to get optional sleep clock\n);
 +   qdwc-sleep_clk = NULL;
 +   }
 +
 +   ret = clk_prepare_enable(qdwc-core_clk);
 +   if (ret) {
 +   dev_err(qdwc-dev, failed to enable core clock\n);
 +   goto err_core;
 +   }
 +
 +   ret = clk_prepare_enable(qdwc-iface_clk);

 Should not we check if  qdwc-iface_clk is valid?
 
 read the sources luke.
Now I read that its initialized to NULL in fail case but should we call
prepare_enable at all if its NULL?
 
 +err_clks:
 +   clk_disable_unprepare(qdwc-sleep_clk);

 IS_ERR check before above statement not needed as we have continued with
 probe even after failure og devm_clk_get?
 
 read more carefully, there's a detail which you're missing.
 
--
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 v9 2/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver

2014-09-12 Thread Pramod Gurav


On 13-09-2014 01:59 AM, Felipe Balbi wrote:
 Hi,
 
 On Sat, Sep 13, 2014 at 01:55:50AM +0530, Pramod Gurav wrote:
 +   qdwc = devm_kzalloc(pdev-dev, sizeof(*qdwc), GFP_KERNEL);
 +   if (!qdwc)
 +   return -ENOMEM;
 +
 +   platform_set_drvdata(pdev, qdwc);
 +
 +   qdwc-dev = pdev-dev;
 +
 +   qdwc-core_clk = devm_clk_get(qdwc-dev, core);
 +   if (IS_ERR(qdwc-core_clk)) {
 +   dev_err(qdwc-dev, failed to get core clock\n);
 +   return PTR_ERR(qdwc-core_clk);
 +   }
 +
 +   qdwc-iface_clk = devm_clk_get(qdwc-dev, iface);
 +   if (IS_ERR(qdwc-iface_clk)) {
 +   dev_dbg(qdwc-dev, failed to get optional iface 
 clock\n);
 +   qdwc-iface_clk = NULL;
 +   }
 +
 +   qdwc-sleep_clk = devm_clk_get(qdwc-dev, sleep);
 +   if (IS_ERR(qdwc-sleep_clk)) {
 +   dev_dbg(qdwc-dev, failed to get optional sleep 
 clock\n);
 +   qdwc-sleep_clk = NULL;
 +   }
 +
 +   ret = clk_prepare_enable(qdwc-core_clk);
 +   if (ret) {
 +   dev_err(qdwc-dev, failed to enable core clock\n);
 +   goto err_core;
 +   }
 +
 +   ret = clk_prepare_enable(qdwc-iface_clk);

 Should not we check if  qdwc-iface_clk is valid?

 read the sources luke.
 Now I read that its initialized to NULL in fail case but should we call
 prepare_enable at all if its NULL?
 
 now read the source of clk_enable() and clk_prepare() ;-) NULL is a
 valid clock, it just returns 0. This is better than sprinkling IS_ERR()
 all over the place.
Seen that. I was wrong about IS_ERR. 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: [RFC PATCH 2/3 ] usb: phy: msm: Make phy_reset clk and reset line optional.

2014-07-17 Thread pramod gurav
Hi Srini,

On Thu, Jul 17, 2014 at 6:19 PM,  pramod.gurav@gmail.com wrote:
 From: Srinivas Kandagatla srinivas.kandaga...@linaro.org

 This patch makes the phy reset clk and reset line optional as this clk
 is not available on boards like IFC6410 with APQ8064.

.
[snip]
.

 pdata-mode = of_usb_get_dr_mode(node);
 if (pdata-mode == USB_DR_MODE_UNKNOWN)
 @@ -1556,7 +1556,7 @@ static int msm_otg_probe(struct platform_device *pdev)
np ? phy : usb_phy_clk);
 if (IS_ERR(motg-phy_reset_clk)) {
 dev_err(pdev-dev, failed to get usb_phy_clk\n);

I keep getting this error on IFC6410. Cant we suppress it?

 -   return PTR_ERR(motg-phy_reset_clk);
 +   motg-phy_reset_clk = NULL;

for non-ifc boards(having this clk), if they have this clock should
not code return on failure to get the usb_phy_clk?

 }

 motg-clk = devm_clk_get(pdev-dev, np ? core : usb_hs_clk);
 --
 1.7.9.5




-- 
Thanks and Regards
Pramod
--
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