All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-can@vger.kernel.org
Cc: kernel@pengutronix.de,
	John Whittington <git@jbrengineering.co.uk>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	stable@vger.kernel.org
Subject: [PATCH 0/2] can: gs_usb: fix time stamp counter initialization
Date: Sun, 16 Jul 2023 21:33:48 +0200	[thread overview]
Message-ID: <20230716-gs_usb-fix-time-stamp-counter-v1-0-9017cefcd9d5@pengutronix.de> (raw)

During testing I noticed a crash if unloading/loading the gs_usb
driver during high CAN bus load.

The current version of the candlelight firmware doesn't flush the
queues of the received CAN frames during the reset command. This leads
to a crash if hardware timestamps are enabled, it a URB from the
device is received before the cycle counter/time counter
infrastructure has been setup.

First clean up then error handling in gs_can_open().

Then, fix the problem by converting the cycle counter/time counter
infrastructure from a per-channel to per-device and set it up before
submitting RX-URBs to the USB stack.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Marc Kleine-Budde (2):
      can: gs_usb: gs_can_open(): improve error handling
      can: gs_usb: fix time stamp counter initialization

 drivers/net/can/usb/gs_usb.c | 130 ++++++++++++++++++++++++-------------------
 1 file changed, 74 insertions(+), 56 deletions(-)
---
base-commit: 0dd1805fe498e0cf64f68e451a8baff7e64494ec
change-id: 20230712-gs_usb-fix-time-stamp-counter-4bd302c808af

Best regards,
-- 
Marc Kleine-Budde <mkl@pengutronix.de>



             reply	other threads:[~2023-07-16 19:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-16 19:33 Marc Kleine-Budde [this message]
2023-07-16 19:33 ` [PATCH 1/2] can: gs_usb: gs_can_open(): improve error handling Marc Kleine-Budde
2023-07-16 19:33 ` [PATCH 2/2] can: gs_usb: fix time stamp counter initialization Marc Kleine-Budde
2023-07-19 12:55 ` [PATCH 0/2] " john
2023-07-20  9:19   ` 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=20230716-gs_usb-fix-time-stamp-counter-v1-0-9017cefcd9d5@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=git@jbrengineering.co.uk \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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.