lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.16 143/357] usb: dwc2/gadget: fix phy disable sequence
    Date
    3.16-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Kamil Debski <k.debski@samsung.com>

    commit 0655314be0d9c54ad5f63500219485c6a9d9e5e2 upstream.

    When the driver is removed s3c_hsotg_phy_disable is called three times
    instead of once. This results in decreasing of the phy reference counter
    below zero and thus consecutive inserts of the module fails.

    This patch removes calls to s3c_hsotg_phy_disable from s3c_hsotg_remove
    and s3c_hsotg_udc_stop.

    s3c_hsotg_udc_stop is called from udc-core.c only after
    usb_gadget_disconnect, which in turn calls s3c_hsotg_pullup, which
    already calls s3c_hsotg_phy_disable.

    s3c_hsotg_remove must be called only after udc_stop, so there is no
    point in disabling phy once again there.

    Signed-off-by: Kamil Debski <k.debski@samsung.com>
    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/usb/dwc2/gadget.c | 3 ---
    1 file changed, 3 deletions(-)

    --- a/drivers/usb/dwc2/gadget.c
    +++ b/drivers/usb/dwc2/gadget.c
    @@ -2898,8 +2898,6 @@ static int s3c_hsotg_udc_stop(struct usb

    spin_lock_irqsave(&hsotg->lock, flags);

    - s3c_hsotg_phy_disable(hsotg);
    -
    if (!driver)
    hsotg->driver = NULL;

    @@ -3586,7 +3584,6 @@ static int s3c_hsotg_remove(struct platf
    usb_gadget_unregister_driver(hsotg->driver);
    }

    - s3c_hsotg_phy_disable(hsotg);
    if (hsotg->phy)
    phy_exit(hsotg->phy);
    clk_disable_unprepare(hsotg->clk);



    \
     
     \ /
      Last update: 2014-10-04 03:01    [W:6.463 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site