Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3133688ybz; Sun, 3 May 2020 18:10:38 -0700 (PDT) X-Google-Smtp-Source: APiQypLYn3j5uqv4PFa/7nLHKr+1ed58Y25bGq63fsU9O/muP+sodIunJ7Qw8g1/mvZLgqg5DU43 X-Received: by 2002:aa7:d0d6:: with SMTP id u22mr13123688edo.262.1588554638598; Sun, 03 May 2020 18:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588554638; cv=none; d=google.com; s=arc-20160816; b=gVIi7ZK603V5WHe5dgecDKae/jDHlb/QBmKxkZByPkZ3xDuv6+1jHJEsTObCHMgk7Q HvniCfbpch2T09Kw/+fzHgjnaV7JkWheUacDH7gg8j1LJX3HYMWhsNhnufh27nHfG760 lgrmwMWrUPODq0sPItjQufAKPduSYV5YPp02WlhUuoR+5/Ing4TZ0Rk0G7AU/pDx5310 2e27LrfKbzVBuzuw+vKKN9MtMJgt56EQiudg5qk++YxHDTCI9UfJzz8ih6rUrn16zhkt rnwYckGYx7CjKpIreUyeIbdbZ1BceyreytgFti/mR350+YEdQ4XUevid23SsIwVwVWxk zP/Q== 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=u4x/K6duRrjN/U+VYAUO8TvmRtrGqcEAA6zUTStm690=; b=GmYAFw9vkj3B7paPL/ulL6/wHtMqXbnmQCak2m2KU+fuLkIy5LShzvkj3zSvqy1UFK jD4WwGwS2oAWUg2EHvK/+gyyLX+z/vkxdOp61Sv4e2QhGwWKDkX96duOft7ZtzAAKRFJ zUgId6lnyAa/Ntxoim0Q571iQh0hErFrbp1vhYF2Cp1EwiN0CiS7aaUt3VObIEZms2Gi 2T5gqcasmlRuhnTx3iRmZTRSp0GtCqgXXPatMRoMUe2kHU2h6JplYWDiS2NH8NfQG8pa 0QVGILohNA+PVT35AY+I8vj2350SrDbNjd2dLE9W6fNZk97JyPfzB9yEMDR4cVJMOQlu ACnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Y5oHIr6O; 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 bi20si6250762edb.233.2020.05.03.18.09.49; Sun, 03 May 2020 18:10:38 -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=Y5oHIr6O; 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 S1726942AbgEDAzE (ORCPT + 99 others); Sun, 3 May 2020 20:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726924AbgEDAzE (ORCPT ); Sun, 3 May 2020 20:55:04 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CD8FC061A0E for ; Sun, 3 May 2020 17:55:02 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id j14so8268581lfg.9 for ; Sun, 03 May 2020 17:55:02 -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=u4x/K6duRrjN/U+VYAUO8TvmRtrGqcEAA6zUTStm690=; b=Y5oHIr6Owb2ec6aZLCXJywDjB4MibUg3widgbcL2hrYY44FRlU7zlKvDzGw9t+JVjo 0RdOHnOMmO6YfXAizXit9SYN7m7EvinkpXkolaNzz7l1GFXx2zynX7roi13CV+SnZ4rt QDwoV3yYnrv3ZOkQb9rRUWyf7BB99jz7WWbiDyOuDFoSDuYlcHrPt9cLGAwLZ/5ckgmy l3JxWRCVrmAqbLTHnib037//E/XbimnviVvnK9LvjdiJKJAOZHzoojFjyvzZR88pnQbE DsEt5ajTv+jtW0R9uMsnTv9dCVKhtski5NWmaO0uar/T+imdTS2dTjQwHI55DNy76Acx E6jw== 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=u4x/K6duRrjN/U+VYAUO8TvmRtrGqcEAA6zUTStm690=; b=raIcF5p+Ben3bPMIGaUzXG0FB9sMZ/GqGReb8XaOzcuw/NtaxHkQ/850MZfkPZppGs yCewDp+j0G1IH8jE3fufugqEJdfdVSkWq39dttPio4jCWbzZ0plc7B33IpS1hKwfem4e 7NCOg+lqnHvlkO6IfctVSxEH/Wrku0d3nEConCYs37k2YD7i0wP2dbphAwgqE/Dm4eDP efGHktwHJPetTNsW5NJpCTaF4KICjZO4pzOZNXopfNcYO71UZbK8HenvjEBezG5Vtm0X 0fdwiI0y4YHGQTAb3i762AQ3Y4w1vHkT4Y2T0sEvuDpAxkz/Zcze6n3tJNrrQzAG4yA0 7KIg== X-Gm-Message-State: AGi0PuZHreS+Tab1+iNbnrd5C4z2RlENtbMfNO1A8yADWha8BKLY3VFz uSgJZjNm2HZcK8dt4+WeVZvAZhSHjHoccgc8kVyv45FP X-Received: by 2002:a19:6a18:: with SMTP id u24mr9989325lfu.191.1588553699665; Sun, 03 May 2020 17:54:59 -0700 (PDT) MIME-Version: 1.0 References: <20200501192218.73993-1-alainm@chromium.org> In-Reply-To: From: Alain Michaud Date: Sun, 3 May 2020 20:54:48 -0400 Message-ID: Subject: Re: [BlueZ PATCH v2] shared/gatt-client:Ignore orphaned characteristics To: Luiz Augusto von Dentz Cc: Alain Michaud , "linux-bluetooth@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 Luiz, On Fri, May 1, 2020 at 4:46 PM Luiz Augusto von Dentz wrote: > > Hi Alain, > > On Fri, May 1, 2020 at 12:27 PM Alain Michaud wrote: > > > > The gatt discovery proceedure simplification to discover all > > characteristics at once has exposed a device side issue where some > > device implementation reports orphaned characteristics. While this > > technically shouldn't be allowed, some instances of this were observed > > (namely on some Android phones). > > > > The fix is to simply skip over orphaned characteristics and continue > > with everything else that is valid. > > > > This has been tested as part of the Android CTS tests against an > > affected platform and was confirmed to have worked around the issue. > > > > Signed-off-by: Alain Michaud > > --- > > > > src/shared/gatt-client.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c > > index 963ad619f..507b4d304 100644 > > --- a/src/shared/gatt-client.c > > +++ b/src/shared/gatt-client.c > > @@ -632,7 +632,13 @@ static bool discover_descs(struct discovery_op *op, bool *discovering) > > util_debug(client->debug_callback, client->debug_data, > > "Failed to insert characteristic at 0x%04x", > > chrc_data->value_handle); > > - goto failed; > > + > > + /* Some devices have been seen reporting orphaned > > + * characteristics. In order to favor interoperability > > + * we skip over characteristics in error > > + */ > > + free(chrc_data); > > + continue; > > } > > > > if (gatt_db_attribute_get_handle(attr) != > > -- > > 2.26.2.526.g744177e7f7-goog > > > > Applied, thanks. Note that I drop the Signed-off-by line since we > don't use that on userspace. Thanks, sorry, this is automatically added by the tools I use to automate the patch upload and I need to remember to remove it. Sadly, it's a manual process and is vulnerable to my poor memory :P > > -- > Luiz Augusto von Dentz