linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Stephane Grosjean <s.grosjean@peak-system.com>
Cc: linux-can Mailing List <linux-can@vger.kernel.org>
Subject: Re: [PATCH 0/3 v5] can/usb: Add PEAK-System PCAN USB adapters driver
Date: Wed, 22 Feb 2012 08:30:19 +0100	[thread overview]
Message-ID: <4F44998B.3040302@hartkopp.net> (raw)
In-Reply-To: <4F44939D.9050703@hartkopp.net>

On 22.02.2012 08:05, Oliver Hartkopp wrote:


> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.519539] peak_usb 2-1.3:1.0: can3: Tx URB aborted (-71)
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.519592] peak_usb 2-1.3:1.0: can2: Tx URB aborted (-71)
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.519632] peak_usb 2-1.3:1.0: can_put_echo_skb: BUG! echo_skb is occupied!
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.519707] peak_usb 2-1.3:1.0: can3: Rx URB aborted (-71)
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.519746] peak_usb 2-1.3:1.0: can_put_echo_skb: BUG! echo_skb is occupied!


(..)

> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.615114] peak_usb 2-1.3:1.0: can2: Tx URB aborted (-108)
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.615117] peak_usb 2-1.3:1.0: can_put_echo_skb: BUG! echo_skb is occupied!
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.615120] peak_usb 2-1.3:1.0: can2: Tx URB aborted (-108)
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.615124] peak_usb 2-1.3:1.0: can_put_echo_skb: BUG! echo_skb is occupied!
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.615130] peak_usb 2-1.3:1.0: can_put_echo_skb: BUG! echo_skb is occupied!
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.623962] peak_usb 2-1.3:1.0: can3: Tx URB aborted (-108)
> Feb 21 20:27:10 vwagwolkf484 kernel: [ 3162.623969] peak_usb 2-1.3:1.0: can3: Tx URB aborted (-108)


-71  => EPROTO          71      /* Protocol error */
-108 => ESHUTDOWN       108     /* Cannot send after transport endpoint shutdown */

+/*
+ * callback for bulk Tx urb
+ */
+static void peak_usb_write_bulk_callback(struct urb *urb)
+{
+       struct peak_tx_urb_context *context = urb->context;
+       struct peak_usb_device *dev;
+       struct net_device *netdev;
+
+       BUG_ON(!context);
+
+       dev = context->dev;
+       netdev = dev->netdev;
+
+       atomic_dec(&dev->active_tx_urbs);
+
+       if (!netif_device_present(netdev))
+               return;
+
+       switch (urb->status) {
+       case 0: /* tx ok */
+               netdev->trans_start = jiffies;
+
+               /* transmission complete interrupt */
+               netdev->stats.tx_packets++;
+               netdev->stats.tx_bytes += context->dlc;
+
+               can_get_echo_skb(netdev, context->echo_index);
+               break;
+
+       case -ENOENT: /* on ifconfig down */
+               break;
+       default:
+               netdev_err(netdev, "Tx URB aborted (%d)\n", urb->status);

Just printing this status and continue with business as usual (netif_wake_queue!) is probably not the right approach 8-)

Please check if it makes sense to check (urb->status != 0) earlier in this callback function.
 
+       }
+
+       /* release context */
+       context->echo_index = PCAN_USB_MAX_TX_URBS;
+
+       netif_wake_queue(netdev);
+}



  reply	other threads:[~2012-02-22  7:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17 12:24 [PATCH 0/3 v5] can/usb: Add PEAK-System PCAN USB adapters driver Stephane Grosjean
2012-02-17 12:24 ` [PATCH 1/3 v5] can/usb: PEAK-System Technik USB adapters driver core Stephane Grosjean
2012-02-22  7:05 ` [PATCH 0/3 v5] can/usb: Add PEAK-System PCAN USB adapters driver Oliver Hartkopp
2012-02-22  7:30   ` Oliver Hartkopp [this message]
2012-02-22 15:19     ` Stephane Grosjean
2012-02-22 16:01       ` Oliver Hartkopp
2012-02-22 16:33         ` Stephane Grosjean
2012-02-22 16:40           ` Oliver Hartkopp
2012-02-22 17:03             ` Stephane Grosjean
2012-02-22 17:50               ` Oliver Hartkopp
2012-02-22 11:03 ` Marc Kleine-Budde

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=4F44998B.3040302@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=linux-can@vger.kernel.org \
    --cc=s.grosjean@peak-system.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;
as well as URLs for NNTP newsgroup(s).