[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <003d83a0-8958-c685-4f4f-4c6b7e2724e7@kernel.org>
Date: Wed, 24 Nov 2021 07:35:59 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: Jeremy Kerr <jk@...econstruct.com.au>, netdev@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Matt Johnston <matt@...econstruct.com.au>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next 1/3] mctp: serial: cancel tx work on ldisc close
On 24. 11. 21, 6:36, Jiri Slaby wrote:
> On 23. 11. 21, 13:50, Jeremy Kerr wrote:
>> We want to ensure that the tx work has finished before returning from
>> the ldisc close op, so do a synchronous cancel.
>>
>> Reported-by: Jiri Slaby <jirislaby@...nel.org>
>> Signed-off-by: Jeremy Kerr <jk@...econstruct.com.au>
>> ---
>> drivers/net/mctp/mctp-serial.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/mctp/mctp-serial.c
>> b/drivers/net/mctp/mctp-serial.c
>> index 9ac0e187f36e..c958d773a82a 100644
>> --- a/drivers/net/mctp/mctp-serial.c
>> +++ b/drivers/net/mctp/mctp-serial.c
>> @@ -478,6 +478,7 @@ static void mctp_serial_close(struct tty_struct *tty)
>> struct mctp_serial *dev = tty->disc_data;
>> int idx = dev->idx;
>> + cancel_work_sync(&dev->tx_work);
>
> But the work still can be queued after the cancel (and before the
> unregister), right?
Maybe do it in ->ndo_uninit()?
>> unregister_netdev(dev->netdev);
>> ida_free(&mctp_serial_ida, idx);
>> }
>>
>
> thanks,
--
js
suse labs
Powered by blists - more mailing lists