Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp946502ybz; Wed, 22 Apr 2020 10:43:23 -0700 (PDT) X-Google-Smtp-Source: APiQypJChd0uEQ1kWEcgSXyt2zZir6S/oDzJU3k/eAwLOfUiJBCBKWRcO9fdDNeqJSvWTd15qa39 X-Received: by 2002:a17:906:300a:: with SMTP id 10mr27317498ejz.139.1587577403066; Wed, 22 Apr 2020 10:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587577403; cv=none; d=google.com; s=arc-20160816; b=RxFwmQMXXr7wdkYmmusSZD3B0qMne5Oxz1/VeAZ2iEHR6NiqMpMJHoYild4pkSVzYx JCaoJKA/IsezmtDH07EAoUAPeFbh1xYTu6prCg4wqH3Fe26YCRbSS4tIkpVhVifC4X9E WYJBiSx230V6jHljhN+547N/ny4gF/TTEsfUxixES6k4aApZHTWx7+wRZv5d75y+wTTk yArzO4fKYqsE5y0kdKzhlYn5q8EtZu4fc3N2oEVNMF6J1OdLUV5KicixArS5kY7I+haA j1ME8IJOxOqKcTfCMlETmc5R8poDY5wA6wZLGak+H7ZVu/Ub6JFIEp/revrh4GPpCA8N SS0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=RPOKQFrp977BJ2P5HPc3xH5w/AljHKYVktg8gFgQq9Y=; b=mwLUdeghAn3KbhUqkTQg5eQUYxZWJyXY2hkX2PEp5fsA5rdvKpBH4E0rFeoafcLayQ biAKrWKhaV6u7/lLnXfGtRk8svTkR70ih4cdIYxsiNhU7f9a+3N30XVZNI/UWBacOTsd RFByfpQggBDRUzIlwk839g9dCsMp3LQXfkOLtk+bZBLwJvfKfCT+JFB7Z7mpxuBR7xgr zzwnQZUyHBGjxuWhlt4mR1aanOYXe5fJrhX1wkdcfoDTRRML0Zo7L4tpk0pa2AqVAP+N vJn+go3BimIk5Sb11WzQ7igyQteVqDl93kFecuIC4hyLv+LhfofO1oixIkX2qRQ3uWDI GmaA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si3953938ejn.415.2020.04.22.10.42.58; Wed, 22 Apr 2020 10:43:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726496AbgDVRmL convert rfc822-to-8bit (ORCPT + 99 others); Wed, 22 Apr 2020 13:42:11 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:34900 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbgDVRmL (ORCPT ); Wed, 22 Apr 2020 13:42:11 -0400 Received: from [192.168.1.91] (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id 46689CECFD; Wed, 22 Apr 2020 19:51:47 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH v1] Bluetooth: L2CAP: add support for waiting disconnection resp From: Marcel Holtmann In-Reply-To: <20200414160758.v1.1.Idab9dcdc7da549ed1fd5c66341fb8baffaee8d10@changeid> Date: Wed, 22 Apr 2020 19:41:39 +0200 Cc: linux-bluetooth , Luiz Augusto von Dentz , Archie Pusaka , "David S. Miller" , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <84DFB53F-C60A-48D3-AC01-2C9C87BA805D@holtmann.org> References: <20200414160758.v1.1.Idab9dcdc7da549ed1fd5c66341fb8baffaee8d10@changeid> To: Archie Pusaka X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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