This is a note to let you know that I've just added the patch titled

    USB: gpio_vbus: provide an appropriate debounce interval

to the 3.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-gpio_vbus-provide-an-appropriate-debounce-interval.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 934ccec4da14dc0586dfe08b36166364bdd2181b Mon Sep 17 00:00:00 2001
From: Shinya Kuribayashi <[email protected]>
Date: Thu, 10 May 2012 10:31:21 +0900
Subject: USB: gpio_vbus: provide an appropriate debounce interval

From: Shinya Kuribayashi <[email protected]>

commit 934ccec4da14dc0586dfe08b36166364bdd2181b upstream.

In commit c2344f13b59e007d782a3e591ebc551bc583a8b7 (USB: gpio_vbus:
add delayed vbus_session calls, 2009-01-24), usb_gadget_vbus_connect()
and ...disconnect() were extracted from the interrupt handler, so to
allow vbus_session handlers to deal with msleep() calls.

This patch takes the approach one step further.

USB2.0 specification (7.1.7.3 Connect and Disconnect Signaling) says
that the USB system software (shall) provide a debounce interval with
a minimum duration of 100 ms, which ensures that the electrical and
mechanical connection is stable before software attempts to reset
the attached device.

Signed-off-by: Shinya Kuribayashi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/usb/otg/gpio_vbus.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/usb/otg/gpio_vbus.c
+++ b/drivers/usb/otg/gpio_vbus.c
@@ -37,7 +37,7 @@ struct gpio_vbus_data {
        struct regulator       *vbus_draw;
        int                     vbus_draw_enabled;
        unsigned                mA;
-       struct work_struct      work;
+       struct delayed_work     work;
 };
 
 
@@ -94,7 +94,7 @@ static int is_vbus_powered(struct gpio_v
 static void gpio_vbus_work(struct work_struct *work)
 {
        struct gpio_vbus_data *gpio_vbus =
-               container_of(work, struct gpio_vbus_data, work);
+               container_of(work, struct gpio_vbus_data, work.work);
        struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data;
        int gpio, status;
 
@@ -152,7 +152,7 @@ static irqreturn_t gpio_vbus_irq(int irq
                otg->gadget ? otg->gadget->name : "none");
 
        if (otg->gadget)
-               schedule_work(&gpio_vbus->work);
+               schedule_delayed_work(&gpio_vbus->work, msecs_to_jiffies(100));
 
        return IRQ_HANDLED;
 }
@@ -300,7 +300,7 @@ static int __init gpio_vbus_probe(struct
 
        ATOMIC_INIT_NOTIFIER_HEAD(&gpio_vbus->phy.notifier);
 
-       INIT_WORK(&gpio_vbus->work, gpio_vbus_work);
+       INIT_DELAYED_WORK(&gpio_vbus->work, gpio_vbus_work);
 
        gpio_vbus->vbus_draw = regulator_get(&pdev->dev, "vbus_draw");
        if (IS_ERR(gpio_vbus->vbus_draw)) {


Patches currently in stable-queue which might be from 
[email protected] are

queue-3.4/usb-gpio_vbus-provide-an-appropriate-debounce-interval.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to