All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
	Stephane Grosjean <s.grosjean@peak-system.com>,
	linux-can Mailing List <linux-can@vger.kernel.org>
Subject: Re: [PATCH 3/3] can/peak_usb: add support of ONE_SHOT mode
Date: Tue, 9 Mar 2021 11:58:38 +0100	[thread overview]
Message-ID: <6aeb7ae5-e2da-df07-dd43-9777c5352a16@pengutronix.de> (raw)
In-Reply-To: <7272e91d-3e27-3b3d-fdbd-818cd073e761@hartkopp.net>


[-- Attachment #1.1: Type: text/plain, Size: 1639 bytes --]

On 3/9/21 11:53 AM, Oliver Hartkopp wrote:
>> What happens if in one shot mode and the frame is not send? Who takes care of
>> the echo skb?
> 
> ONE-SHOT only means that the CAN controller would not retry the 
> transmission when e.g. loosing the arbitration or getting an error flag.
> 
> The sja1000 does it this way, when the TX interrupt flag is set in the 
> interrupt register:
> 
>                  if (isrc & IRQ_TI) {
>                          /* transmission buffer released */
>                          if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT &&
>                              !(status & SR_TCS)) {
>                                  stats->tx_errors++;
>                                  can_free_echo_skb(dev, 0);
>                          } else {
>                                  /* transmission complete */
>                                  stats->tx_bytes +=
>                                          priv->read_reg(priv, 
> SJA1000_FI) & 0xf;
>                                  stats->tx_packets++;
>                                  can_get_echo_skb(dev, 0, NULL);
>                          }
>                          netif_wake_queue(dev);
>                          can_led_event(dev, CAN_LED_EVENT_TX);
>                  }
> 
> 
> Do we need to check this for the other drivers?

Yes.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-03-09 10:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09  8:21 [PATCH 0/3] can/peak_usb: Added improvement to the peak_usb driver Stephane Grosjean
2021-03-09  8:21 ` [PATCH 1/3] can/peak_usb: add support of ethtool set_phys_id() Stephane Grosjean
2021-03-09 11:20   ` Marc Kleine-Budde
2021-03-09 12:15   ` Marc Kleine-Budde
2021-03-19  8:35     ` Marc Kleine-Budde
2021-03-09  8:21 ` [PATCH 2/3] can/peak_usb: add forgotten supported devices Stephane Grosjean
2021-03-09 11:07   ` Marc Kleine-Budde
2021-03-09 14:22     ` Stéphane Grosjean
2021-03-09 15:27       ` Marc Kleine-Budde
2021-03-09 15:28   ` Marc Kleine-Budde
2021-03-19  8:39     ` Marc Kleine-Budde
2021-03-19  9:47       ` Vincent MAILHOL
2021-03-19  9:56         ` Marc Kleine-Budde
2021-03-19 10:07           ` Vincent MAILHOL
2021-03-19 12:00             ` Stéphane Grosjean
2021-03-09  8:21 ` [PATCH 3/3] can/peak_usb: add support of ONE_SHOT mode Stephane Grosjean
2021-03-09 10:36   ` Marc Kleine-Budde
2021-03-09 10:53     ` Oliver Hartkopp
2021-03-09 10:58       ` Marc Kleine-Budde [this message]
2021-03-19 10:01   ` Marc Kleine-Budde
2021-03-09 14:53 Stéphane Grosjean
2021-03-09 14:58 ` Marc Kleine-Budde
2021-03-10 11:18 Stéphane Grosjean
2021-03-10 11:53 ` 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=6aeb7ae5-e2da-df07-dd43-9777c5352a16@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=s.grosjean@peak-system.com \
    --cc=socketcan@hartkopp.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.