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

    can: kvaser_usb: Retry the first bulk transfer on -ETIMEDOUT

to the 3.18-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:
     can-kvaser_usb-retry-the-first-bulk-transfer-on-etimedout.patch
and it can be found in the queue-3.18 subdirectory.

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


>From 14c10c2a1dd8eb8e00b750b521753260befa2789 Mon Sep 17 00:00:00 2001
From: "Ahmed S. Darwish" <[email protected]>
Date: Mon, 26 Jan 2015 07:24:06 +0200
Subject: can: kvaser_usb: Retry the first bulk transfer on -ETIMEDOUT

From: "Ahmed S. Darwish" <[email protected]>

commit 14c10c2a1dd8eb8e00b750b521753260befa2789 upstream.

On some x86 laptops, plugging a Kvaser device again after an
unplug makes the firmware always ignore the very first command.
For such a case, provide some room for retries instead of
completely exiting the driver init code.

Signed-off-by: Ahmed S. Darwish <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/net/can/usb/kvaser_usb.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- a/drivers/net/can/usb/kvaser_usb.c
+++ b/drivers/net/can/usb/kvaser_usb.c
@@ -1588,7 +1588,7 @@ static int kvaser_usb_probe(struct usb_i
 {
        struct kvaser_usb *dev;
        int err = -ENOMEM;
-       int i;
+       int i, retry = 3;
 
        dev = devm_kzalloc(&intf->dev, sizeof(*dev), GFP_KERNEL);
        if (!dev)
@@ -1606,7 +1606,15 @@ static int kvaser_usb_probe(struct usb_i
 
        usb_set_intfdata(intf, dev);
 
-       err = kvaser_usb_get_software_info(dev);
+       /* On some x86 laptops, plugging a Kvaser device again after
+        * an unplug makes the firmware always ignore the very first
+        * command. For such a case, provide some room for retries
+        * instead of completely exiting the driver.
+        */
+       do {
+               err = kvaser_usb_get_software_info(dev);
+       } while (--retry && err == -ETIMEDOUT);
+
        if (err) {
                dev_err(&intf->dev,
                        "Cannot get software infos, error %d\n", err);


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

queue-3.18/can-kvaser_usb-do-not-sleep-in-atomic-context.patch
queue-3.18/can-kvaser_usb-send-correct-context-to-urb-completion.patch
queue-3.18/can-kvaser_usb-fix-state-handling-upon-bus_error-events.patch
queue-3.18/can-kvaser_usb-retry-the-first-bulk-transfer-on-etimedout.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