Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1659033ybz; Thu, 23 Apr 2020 03:16:41 -0700 (PDT) X-Google-Smtp-Source: APiQypIHCR/lBYOI/d8WKNm+8dNCDdhb5lCuwuzo7+jlBoViOGOY7AgShYKc19H82w7dNp5UdR2D X-Received: by 2002:aa7:cb0f:: with SMTP id s15mr1982609edt.164.1587637001658; Thu, 23 Apr 2020 03:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587637001; cv=none; d=google.com; s=arc-20160816; b=LhnhLS4Hgg83D2nWlEGr2YVTbdBkDY/XZdWcx2cwbbu4E4g255XS3rMbRw7czcTQjp /LNgbpUQg92/C38wRfUG/VTDogeye2w/HHEv9d1pdD8Cu5T5nku+to1swNH6rIuDgifc SNubkxnwmFXAEZE0/OQFyVBFtFU9IJMq8xvkJKFTdBZisKlQ8cQDXCViC7aEj9viyUO5 NStGGEfC57hxvzR0hpGLtu/OeOXLWZtys0Xr92U1u1JgsASJTHRZK+ivpajMBMgNyI7B tGffTei17n90TosH33V6o0/suVg24RwoI34sBGIcPqniR7k9NdL7gR4U9iJJ0VBNMvek epvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Skhk4DHSP6S49ay3YbxbGVfdsBzay3NHmVMdnxxjSrE=; b=dk3ctTgekskUIH9l0eNMM572pVy9ionHezcFIfh0k+4lunz15EbXMp+hCNhRo9Bgny 6ZcFuzOyIUBgdcJQ6wgzxis7/VNWV89kgcsjLv/J14w6qSxu9n4+GVyOpk7mVlj7F6DU L9K2sLAUMZyRnPJlXb5CGg+71p2KPidwxT3OuVbVJ4d2+qZc1ogfkurPy9TUSDxmi8A1 TwOgFrJw7gtNb/clWHKkvmqPj7Os6l9akNGQ0EdnHzS22BfkQQZPeqZ/GOzOLR9+s4Nh Jf5UU3cH3v5UhwMPpTAK/kvYKgUlQVZqvB/Fc+QJilcuRufBKHXmhbFghRwFKFBLhVPH CeTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=I+TLKuAs; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si984418edi.509.2020.04.23.03.16.01; Thu, 23 Apr 2020 03:16:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=I+TLKuAs; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726764AbgDWKP5 (ORCPT + 99 others); Thu, 23 Apr 2020 06:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725863AbgDWKP4 (ORCPT ); Thu, 23 Apr 2020 06:15:56 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BD5DC03C1AF for ; Thu, 23 Apr 2020 03:15:56 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id s10so6188455wrr.0 for ; Thu, 23 Apr 2020 03:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Skhk4DHSP6S49ay3YbxbGVfdsBzay3NHmVMdnxxjSrE=; b=I+TLKuAs2kcILC8r2y31+Fs6kHHC22w89oNz8ZAuEz7a/NwAHyHRhH49lQ99XqFuuo R3IhyHzvFan0ZxMjjmeJfK6vIg83WNw9iTLpInlpuRh0PdnRrn0QvWtkQOg44kqgRhvV 6DE3DLosEbf6c35JWsxRezJggy2MUC2ISZmcIDlEBwPlnlZnKh5IFCFfY5isGVsrhkSe AhshvpJ43SI2JP/9sqEtpMJfPwKQBtcEIfCfOo9Ifjn3Uc+GWmZyiKDrdDwhi1TlvmcU OlaVa8Mi7yl+XSaQD426NmRdLYTQGFvtCyaSwMijaGAre7Qrmkw3FVmrCfkp2xlHM9CH 1ndg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Skhk4DHSP6S49ay3YbxbGVfdsBzay3NHmVMdnxxjSrE=; b=gG7499hM+zSmiVr9YjkzHOCk2nbdJT4TT4L72yXgZhfvF/xZOqF3ydaaxmvLwaWHM0 EHRMM4QZ/ZhaDTXiBDAcx4Y8kdMFgV+Cf6bbA9l0ol7kXXkg4cxyTha3IZ1rEfbSoTlJ dOnC582hWBTKd1c5FbFiEtksNhFtuGje2VvB/DDCOH8Hp68UXKVvkc9LRJSaJzIo9K86 Sj7FjAtIAXAa9r1FFHJsVgdnsjPphjHvUoVut5A80zvEHtsmiH10oEpvOzoAhbmlZbMk 7YVX2PkL+EMA4MvJj0D3l5+1qtXHhxyTSEndCUaqXUJ8A/9QbaaHyB/JYbshuVRI6Vzx x3MQ== X-Gm-Message-State: AGi0PuY6QNPHY2mCAh7QItqs2GQ3aTOVrSa8K8vbnerNh51gsyMUDtTE 5U4GrNUEjYbdonKZHjHmujhcb8Ksls8yZegcpISeRQ== X-Received: by 2002:a5d:6887:: with SMTP id h7mr4078989wru.365.1587636954682; Thu, 23 Apr 2020 03:15:54 -0700 (PDT) MIME-Version: 1.0 References: <20200414160758.v1.1.Idab9dcdc7da549ed1fd5c66341fb8baffaee8d10@changeid> <84DFB53F-C60A-48D3-AC01-2C9C87BA805D@holtmann.org> In-Reply-To: <84DFB53F-C60A-48D3-AC01-2C9C87BA805D@holtmann.org> From: Archie Pusaka Date: Thu, 23 Apr 2020 18:15:43 +0800 Message-ID: Subject: Re: [PATCH v1] Bluetooth: L2CAP: add support for waiting disconnection resp To: Marcel Holtmann Cc: linux-bluetooth , Luiz Augusto von Dentz , Archie Pusaka , "David S. Miller" , Jakub Kicinski , Johan Hedberg , LKML , netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Marcel, Let me write a test for that. However, I cannot seem to run l2cap-tester properly. On raspberry pi, all of the tests failed to initiate. On chromeOS, all BREDR tests pass (before and after the change), but all LE tests timed out on init stage (before and after the change). I need to find out what went wrong when I execute those tests first. Thanks, Archie On Thu, 23 Apr 2020 at 01:42, Marcel Holtmann wrote: > > 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 > > --- > > > > 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 >