From: Jimmy Assarsson <jimmyassarsson@gmail.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org,
Anssi Hannula <anssi.hannula@bitwise.fi>,
Jimmy Assarsson <extja@kvaser.com>
Subject: Re: [PATCH can-next v5 01/11] can: kvaser_usb: Fix possible completions during init_completion
Date: Wed, 26 Oct 2022 20:04:39 +0200 [thread overview]
Message-ID: <f53a9afa-42fa-73b0-4dfa-f1684bacf63e@gmail.com> (raw)
In-Reply-To: <20221026081432.5lrzl5tkcfp7gzxj@pengutronix.de>
On 10/26/22 10:14, Marc Kleine-Budde wrote:
> On 10.10.2022 20:52:27, Jimmy Assarsson wrote:
>> From: Anssi Hannula <anssi.hannula@bitwise.fi>
>>
>> kvaser_usb uses completions to signal when a response event is received
>> for outgoing commands.
>>
>> However, it uses init_completion() to reinitialize the start_comp and
>> stop_comp completions before sending the start/stop commands.
>>
>> In case the device sends the corresponding response just before the
>> actual command is sent, complete() may be called concurrently with
>> init_completion() which is not safe.
>>
>> This might be triggerable even with a properly functioning device by
>> stopping the interface (CMD_STOP_CHIP) just after it goes bus-off (which
>> also causes the driver to send CMD_STOP_CHIP when restart-ms is off),
>> but that was not tested.
>>
>> Fix the issue by using reinit_completion() instead.
>
> Looks like this should go to net instead of net-next.
Yes, I agree.
Thanks!
/jimmy
> Marc
next prev parent reply other threads:[~2022-10-26 18:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-10 18:52 [PATCH can-next v5 00/11] can: kvaser_usb: Fixes and improvements Jimmy Assarsson
2022-10-10 18:52 ` [PATCH can-next v5 01/11] can: kvaser_usb: Fix possible completions during init_completion Jimmy Assarsson
2022-10-26 8:14 ` Marc Kleine-Budde
2022-10-26 18:04 ` Jimmy Assarsson [this message]
2022-10-10 18:52 ` [PATCH can-next v5 02/11] can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device Jimmy Assarsson
2022-10-10 18:52 ` [PATCH can-next v5 03/11] can: kvaser_usb: kvaser_usb_leaf: Rename {leaf,usbcan}_cmd_error_event to {leaf,usbcan}_cmd_can_error_event Jimmy Assarsson
2022-10-10 18:52 ` [PATCH can-next v5 04/11] can: kvaser_usb: kvaser_usb_leaf: Handle CMD_ERROR_EVENT Jimmy Assarsson
2022-10-10 18:52 ` [PATCH can-next v5 05/11] can: kvaser_usb_leaf: Set Warning state even without bus errors Jimmy Assarsson
2022-10-10 18:52 ` [PATCH can-next v5 06/11] can: kvaser_usb_leaf: Fix improved state not being reported Jimmy Assarsson
2022-10-10 18:52 ` [PATCH can-next v5 07/11] can: kvaser_usb_leaf: Fix wrong CAN state after stopping Jimmy Assarsson
2022-10-10 18:52 ` [PATCH can-next v5 08/11] can: kvaser_usb_leaf: Ignore stale bus-off after start Jimmy Assarsson
2022-10-10 18:52 ` [PATCH can-next v5 09/11] can: kvaser_usb_leaf: Fix bogus restart events Jimmy Assarsson
2022-10-10 18:52 ` [PATCH can-next v5 10/11] can: kvaser_usb: Add struct kvaser_usb_busparams Jimmy Assarsson
2022-10-19 21:57 ` Marc Kleine-Budde
2022-10-10 18:52 ` [PATCH can-next v5 11/11] can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming Jimmy Assarsson
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=f53a9afa-42fa-73b0-4dfa-f1684bacf63e@gmail.com \
--to=jimmyassarsson@gmail.com \
--cc=anssi.hannula@bitwise.fi \
--cc=extja@kvaser.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
/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