public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomoya MORINAGA <tomoya.rohm@gmail.com>
To: Felipe Balbi <balbi@ti.com>, Greg Kroah-Hartman <gregkh@suse.de>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: qi.wang@intel.com, yong.y.wang@intel.com, joel.clark@intel.com,
	kok.howg.ewe@intel.com, Tomoya MORINAGA <tomoya.rohm@gmail.com>
Subject: [PATCH 3/6 v2] usb/gadget/pch_udc: Fix USB suspend issue
Date: Thu, 12 Jan 2012 11:27:07 +0900	[thread overview]
Message-ID: <1326335230-32469-3-git-send-email-tomoya.rohm@gmail.com> (raw)
In-Reply-To: <1326335230-32469-1-git-send-email-tomoya.rohm@gmail.com>

ISSUE:
After USB Suspend, a system rarely freezes.

CAUSE:
When USB Suspend occurred, the driver is not notifying a gadget of the event.

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
---
V2: Divide into 6 patches
---
 drivers/usb/gadget/pch_udc.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
index 78a2fce..6cd9e21 100644
--- a/drivers/usb/gadget/pch_udc.c
+++ b/drivers/usb/gadget/pch_udc.c
@@ -2480,8 +2480,15 @@ static void pch_udc_dev_isr(struct pch_udc_dev *dev, u32 dev_intr)
 	if (dev_intr & UDC_DEVINT_SC)
 		pch_udc_svc_cfg_interrupt(dev);
 	/* USB Suspend interrupt */
-	if (dev_intr & UDC_DEVINT_US)
+	if (dev_intr & UDC_DEVINT_US) {
+		if (dev->driver
+			&& dev->driver->suspend) {
+			spin_unlock(&dev->lock);
+			dev->driver->suspend(&dev->gadget);
+			spin_lock(&dev->lock);
+		}
 		dev_dbg(&dev->pdev->dev, "USB_SUSPEND\n");
+	}
 	/* Clear the SOF interrupt, if enabled */
 	if (dev_intr & UDC_DEVINT_SOF)
 		dev_dbg(&dev->pdev->dev, "SOF\n");
-- 
1.7.4.4


  parent reply	other threads:[~2012-01-12  2:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12  2:27 [PATCH 1/6 v2] usb/gadget/pch_udc: Fix disconnect issue Tomoya MORINAGA
2012-01-12  2:27 ` [PATCH 2/6 v2] usb/gadget/pch_udc: Fix wrong return value Tomoya MORINAGA
2012-01-12  2:27 ` Tomoya MORINAGA [this message]
2012-01-12  2:27 ` [PATCH 4/6 v2] usb/gadget/pch_udc: Fix usb/gadget/pch_udc: Fix ether gadget connect/disconnect issue Tomoya MORINAGA
2012-01-12  2:27 ` [PATCH 5/6 v2] usb/gadget/pch_udc: Reduce redundant interrupt Tomoya MORINAGA
2012-01-12  2:27 ` [PATCH 6/6 v2] usb/gadget/pch_udc: Add debug message Tomoya MORINAGA
2012-01-12 12:12 ` [PATCH 1/6 v2] usb/gadget/pch_udc: Fix disconnect issue Sergei Shtylyov
2012-01-13  4:12   ` Tomoya MORINAGA
2012-01-24  9:39 ` Felipe Balbi

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=1326335230-32469-3-git-send-email-tomoya.rohm@gmail.com \
    --to=tomoya.rohm@gmail.com \
    --cc=balbi@ti.com \
    --cc=gregkh@suse.de \
    --cc=joel.clark@intel.com \
    --cc=kok.howg.ewe@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=qi.wang@intel.com \
    --cc=yong.y.wang@intel.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