From: Robert Baldyga <r.baldyga@samsung.com>
To: Paul.Zimmerman@synopsys.com
Cc: gregkh@linuxfoundation.org, balbi@ti.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
m.szyprowski@samsung.com, andrzej.p@samsung.com,
Kamil Debski <k.debski@samsung.com>,
Robert Baldyga <r.baldyga@samsung.com>
Subject: [PATCH RESEND v3 01/12] usb: dwc2/gadget: fix phy disable sequence
Date: Tue, 19 Aug 2014 10:54:07 +0200 [thread overview]
Message-ID: <1408438458-3317-2-git-send-email-r.baldyga@samsung.com> (raw)
In-Reply-To: <1408438458-3317-1-git-send-email-r.baldyga@samsung.com>
From: Kamil Debski <k.debski@samsung.com>
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>
---
drivers/usb/dwc2/gadget.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 0ba9c33..d27417e 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2897,8 +2897,6 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
spin_lock_irqsave(&hsotg->lock, flags);
- s3c_hsotg_phy_disable(hsotg);
-
if (!driver)
hsotg->driver = NULL;
@@ -3582,7 +3580,6 @@ static int s3c_hsotg_remove(struct platform_device *pdev)
usb_gadget_unregister_driver(hsotg->driver);
}
- s3c_hsotg_phy_disable(hsotg);
if (hsotg->phy)
phy_exit(hsotg->phy);
clk_disable_unprepare(hsotg->clk);
--
1.9.1
next prev parent reply other threads:[~2014-08-19 8:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 8:54 [PATCH RESEND v3 00/12] usb: dwc2/gadget: fix series Robert Baldyga
2014-08-19 8:54 ` Robert Baldyga [this message]
2014-08-19 8:54 ` [PATCH RESEND v3 02/12] usb: dwc2/gadget: fix phy initialization sequence Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 03/12] usb: dwc2/gadget: move phy bus legth initialization Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 04/12] usb: dwc2/gadget: Fix comment text Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 05/12] usb: dwc2/gadget: hide some not really needed debug messages Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 06/12] usb: dwc2/gadget: ensure that all fifos have correct memory buffers Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 07/12] usb: dwc2/gadget: break infinite loop in endpoint disable code Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 08/12] usb: dwc2/gadget: do not call disconnect method in pullup Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 09/12] usb: dwc2/gadget: delay enabling irq once hardware is configured properly Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 10/12] usb: dwc2/gadget: assign TX FIFO dynamically Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 11/12] usb: dwc2/gadget: disable clock when it's not needed Robert Baldyga
2014-08-19 8:54 ` [PATCH RESEND v3 12/12] usb: dwc2/gadget: avoid disabling ep0 Robert Baldyga
2014-08-19 15:46 ` [PATCH RESEND v3 00/12] usb: dwc2/gadget: fix series Paul Zimmerman
2014-08-19 16:15 ` gregkh
2014-08-19 17:56 ` Paul Zimmerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408438458-3317-2-git-send-email-r.baldyga@samsung.com \
--to=r.baldyga@samsung.com \
--cc=Paul.Zimmerman@synopsys.com \
--cc=andrzej.p@samsung.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=k.debski@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®