Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4225602ybi; Mon, 15 Jul 2019 05:52:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzem8xM1t5qeaTr8aHZvUpnXNTr5Y5XIin3o6OVRRSsBVi7qbw48j/AfCHEHvYq6f9C3bWX X-Received: by 2002:a17:902:e011:: with SMTP id ca17mr28797737plb.328.1563195142075; Mon, 15 Jul 2019 05:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563195142; cv=none; d=google.com; s=arc-20160816; b=JICP2y4RYwSRqSgCgCpUywJ23QRf6l4B7JwLq6psxfaPOM/Jij0h0pu3T8Tu9aFo8m 9qbwbxU7UvaOxkisi2iRKz1/DDH7PFEqiLuDb61EI1coNo7eNBKfjgmQcu0s5c6td71G 83/jRucuG0Vv/o6/eEeoCmrs+oKWA/S2NgfrHzvuolMjTGSLxlIXre/DeX/XbKOuJDtF MqjDAGwSIvzIElt1wiEclQd03Qe3+eivBVjb+cV4jKY+zAl5d1rpennmIgTToxGQeRjc c4+tTmC1CC59GO46MR45aPuWHxyIgnWH+hB5yztiLGsP+WZBCY/8j60IP07IKhHrI+M3 zsRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=uW9ZbqyI7Efd9W1Wys1KIdshufsy2OCMex5cqnA5RuY=; b=x4dhAtEwU2TDT/vUZm0PFPqf023eFxEeXbhPkBULncrIn8yNQ7JvZtqutEKlO/fIdo RQomQimyMCe1vq14CZOygCdge7ek5A3Ejk6tsvm0NkDalWWOBlMKD0uKFBuV368GRsa0 3hFHcpJEagoVdLxpRAitcv57VmwslLPZIsVLlhzSDEKjRipzwZ/vFs4w3AxC22vNk5Jb rFCWhOy/djrQGF8388Q21FTVNi4O+hSHOG7Ews+EVdJdTie7VcjvhdIaOWyG4rpwLjuX KtP+MtfDoHxtwxIacw8xm1BWZSp3B2d8hnqg8/4EBN4PfxI+c2tb073xqrYf9r8K84ZM ciFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=Ay6HzyVp; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si16991342pfe.188.2019.07.15.05.51.52; Mon, 15 Jul 2019 05:52:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=Ay6HzyVp; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730012AbfGOMvt (ORCPT + 99 others); Mon, 15 Jul 2019 08:51:49 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:42549 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728933AbfGOMvt (ORCPT ); Mon, 15 Jul 2019 08:51:49 -0400 Received: by mail-lj1-f194.google.com with SMTP id t28so16060368lje.9 for ; Mon, 15 Jul 2019 05:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:in-reply-to :references:mime-version:content-transfer-encoding; bh=uW9ZbqyI7Efd9W1Wys1KIdshufsy2OCMex5cqnA5RuY=; b=Ay6HzyVpfzl2uq8IUbydWoyTA/dBs7ZpPAYVHVjL3KieLE0NUQe/aoxgMqCNmzURpz Z8vcg8frRTh0QOwQ6XXglVTVuLXMJWNRWg2Dm4vF2sxTyuD7MYBtBoy1qeVuKT6sWNiu cB7gz38o2BzLB8mMhKk6CumrjJFmncK7dRn84SuPTR7t/7fpZb45Gej72hcrBF06vRCS ghsre6ieXAUmOMMxRiNTdVsfVAH6oArzgdo1KeUL0vV3LTmv9rnwluTIsNVRiM0W8oMg bsriN2QDoS319eiZF5mexNVvzpCQBIDXcXagVHIJdyeRhK28ioQ798txbaYn0nav7dtX Boxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :in-reply-to:references:mime-version:content-transfer-encoding; bh=uW9ZbqyI7Efd9W1Wys1KIdshufsy2OCMex5cqnA5RuY=; b=sMAAkgYkbDHrcL8tytK83ohYw2xyVdxjuk56MbEoyAiVp+FbokZGheSy4w5bjAo3hP rjKi3qUAqtsOn+WSA2qQbAbtHtgtUZSPUSG43Y63iaqzMtfwPhJZomchpQrmq9FxiSmQ KdfDmAvsYEICGeQdp6b1fdcrIO55qj3GOKamosgqXfCYLD3oxtSMj+7PfIzUCT03Cvik KYtEd3Ji59rtV9JE5FQZns4YCi75h9YHCZ+qPGLNQmst3kJ7ar920HO/mlorjxkD81Zl jiRFb7572P/mficwFhEdDfUIhGt1IK+vNowdYvhb8Y+wpqz41SWpeLppi8mb3B9DwvCu 8DBA== X-Gm-Message-State: APjAAAU/fEAYQG5ZN+KPVBgAWZzP9X6gLfPtzC9A1N1DsUSsrptUl9pX mCi5rDcJSNgx9Pvw9wSo0Y3OJOdyE1U= X-Received: by 2002:a2e:980e:: with SMTP id a14mr14145065ljj.60.1563195107143; Mon, 15 Jul 2019 05:51:47 -0700 (PDT) Received: from ix.localnet ([95.143.243.62]) by smtp.gmail.com with ESMTPSA id t1sm3147039lji.52.2019.07.15.05.51.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 15 Jul 2019 05:51:46 -0700 (PDT) From: Szymon Janc To: Bastien Nocera Cc: linux-bluetooth@vger.kernel.org, Benjamin Tissoires Subject: Re: [PATCH] input/hog: Remove HID device after HoG device disconnects Date: Mon, 15 Jul 2019 14:51:44 +0200 Message-ID: <1623552.bYGA88Ch3a@ix> Organization: CODECOUP In-Reply-To: <20190614153125.2605-1-hadess@hadess.net> References: <20190614153125.2605-1-hadess@hadess.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, On Friday, 14 June 2019 17:31:25 CEST Bastien Nocera wrote: > From: Benjamin Tissoires > > When the Bluetooth LE device disconnects, make sure to also destroy the > uHID device so that we don't have a lingering HID device accessible from > user-space. > > This also fixes the input subsystem never seeing the device reattaching, > causing settings that should be applied on connection not to be applied. > > https://bugzilla.kernel.org/show_bug.cgi?id=202909 > > Tested-by: Bastien Nocera > --- > profiles/input/hog.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/profiles/input/hog.c b/profiles/input/hog.c > index 23c9c1529..83c017dcb 100644 > --- a/profiles/input/hog.c > +++ b/profiles/input/hog.c > @@ -199,6 +199,8 @@ static int hog_disconnect(struct btd_service *service) > struct hog_device *dev = btd_service_get_user_data(service); > > bt_hog_detach(dev->hog); > + bt_hog_unref(dev->hog); > + dev->hog = NULL; > > btd_service_disconnecting_complete(service, 0); I've tested this with device I have and introduced delay is acceptable imho. Since this fix end-user usabiblity for some of the devices on the market I think the trade-off is justified. Patch is now applied. -- pozdrawiam Szymon Janc