linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] can/peak_usb: Added improvement to the peak_usb driver
@ 2021-03-09  8:21 Stephane Grosjean
  2021-03-09  8:21 ` [PATCH 1/3] can/peak_usb: add support of ethtool set_phys_id() Stephane Grosjean
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Stephane Grosjean @ 2021-03-09  8:21 UTC (permalink / raw)
  To: linux-can Mailing List; +Cc: Stephane Grosjean

This series of patches adds the following improvements:

- allows to identify CAN ports by their LEDs
- completes the list of devices supported by the module
- adds ONE_SHOT mode to some devices

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Stephane Grosjean (3):
  can/peak_usb: add support of ethtool set_phys_id() callback
  can/peak_usb: add forgotten supported devices
  can/peak_usb: add support of ONE_SHOT mode

 drivers/net/can/usb/peak_usb/pcan_usb.c      | 47 ++++++++++++++++++++
 drivers/net/can/usb/peak_usb/pcan_usb_core.c |  4 ++
 drivers/net/can/usb/peak_usb/pcan_usb_core.h |  2 +
 drivers/net/can/usb/peak_usb/pcan_usb_fd.c   | 47 ++++++++++++++++++--
 drivers/net/can/usb/peak_usb/pcan_usb_pro.c  | 46 +++++++++++++++++--
 drivers/net/can/usb/peak_usb/pcan_usb_pro.h  |  6 +++
 6 files changed, 144 insertions(+), 8 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [PATCH 3/3] can/peak_usb: add support of ONE_SHOT mode
@ 2021-03-09 14:53 Stéphane Grosjean
  2021-03-09 14:58 ` Marc Kleine-Budde
  0 siblings, 1 reply; 24+ messages in thread
From: Stéphane Grosjean @ 2021-03-09 14:53 UTC (permalink / raw)
  To: Marc Kleine-Budde, Oliver Hartkopp, linux-can Mailing List

In the usb drivers, the echo skb is always released by the USB write complete callback.


--- Stéphane





            From: Marc Kleine-Budde
Sent: Tuesday, March 9, 2021 11:58
To: Oliver Hartkopp; Stéphane Grosjean; linux-can Mailing List
Subject: Re: [PATCH 3/3] can/peak_usb: add support of ONE_SHOT mode




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 |






--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt - HRB 9183
Geschaeftsfuehrung: Alexander Gach / Uwe Wilhelm
Unsere Datenschutzerklaerung mit wichtigen Hinweisen
zur Behandlung personenbezogener Daten finden Sie unter
www.peak-system.com/Datenschutz.483.0.html

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [PATCH 3/3] can/peak_usb: add support of ONE_SHOT mode
@ 2021-03-10 11:18 Stéphane Grosjean
  2021-03-10 11:53 ` Marc Kleine-Budde
  0 siblings, 1 reply; 24+ messages in thread
From: Stéphane Grosjean @ 2021-03-10 11:18 UTC (permalink / raw)
  To: Marc Kleine-Budde, Oliver Hartkopp; +Cc: linux-can Mailing List

Hello,

To complete the open reflection on this subject: to be perfect, the echo skb should in fact not be released by the USB write completion routine but, like the PCI/PCIe version, on reception in the Rx queue of an echo frame to the one written...

This means :
1 - the core of the peak_usb driver has to be deeply modified
2 - the rx path of the USB interface will be much more loaded, resulting in a higher CPU load
2 - in the case of a one-shot frame, how to manage the fact that this echo frame is never received because the one-shot frame could not be written on the bus? Does this need a garbage collector on the echo skbs?

Is it worth it?

Regards,

--- Stéphane


            From: Marc Kleine-Budde
Sent: Tuesday, March 9, 2021 15:58
To: Stéphane Grosjean
Cc: Oliver Hartkopp; linux-can Mailing List
Subject: Re: [PATCH 3/3] can/peak_usb: add support of ONE_SHOT mode




On 09.03.2021 14:53:36, Stéphane Grosjean wrote:

> In the usb drivers, the echo skb is always released by the USB write

> complete callback.



This means there will be an echo_skb_get() when the USB write completes,

which is usually before the CAN controller sends the CAN frame.



This means a TX complete or an TX abort due to one shot mode will not be

reported?



regards,

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 |


--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt - HRB 9183
Geschaeftsfuehrung: Alexander Gach / Uwe Wilhelm
Unsere Datenschutzerklaerung mit wichtigen Hinweisen
zur Behandlung personenbezogener Daten finden Sie unter
www.peak-system.com/Datenschutz.483.0.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2021-03-19 12:01 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).