Re: [PATCH v1] Bluetooth: L2CAP: add support for waiting disconnection resp

From: Marcel Holtmann
Date: Wed Apr 22 2020 - 13:42:12 EST


Hi Archie,

> Whenever we disconnect a L2CAP connection, we would immediately
> report a disconnection event (EPOLLHUP) to the upper layer, without
> waiting for the response of the other device.
>
> This patch offers an option to wait until we receive a disconnection
> response before reporting disconnection event, by using the "how"
> parameter in l2cap_sock_shutdown(). Therefore, upper layer can opt
> to wait for disconnection response by shutdown(sock, SHUT_WR).
>
> This can be used to enforce proper disconnection order in HID,
> where the disconnection of the interrupt channel must be complete
> before attempting to disconnect the control channel.
>
> Signed-off-by: Archie Pusaka <apusaka@xxxxxxxxxxxx>
> ---
>
> net/bluetooth/l2cap_sock.c | 30 +++++++++++++++++++++++-------
> 1 file changed, 23 insertions(+), 7 deletions(-)

the patch looks fine to me. Do we have something in l2cap-tester or l2test that we can verify this with before I apply it.

Regards

Marcel