Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1064118ybz; Fri, 1 May 2020 13:46:42 -0700 (PDT) X-Google-Smtp-Source: APiQypIGUikM6GSDtf8UqKw23EW2nCTNslj0VnhJmdfomEJfM91dYvst5MsOT4Rt8hl82SZI4+i2 X-Received: by 2002:a50:f0dc:: with SMTP id a28mr4886533edm.87.1588366002194; Fri, 01 May 2020 13:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588366002; cv=none; d=google.com; s=arc-20160816; b=E3ouuyRnkMiVZ3WalVgPkH5h1xGcMUkcG21/yathVzvfqcamPy9oCIpJp9J7uBviq+ 4Is+b0ntNwUkMxMj5MjWhyeNiSyHUD1TVZ6PFk85Bjxz0ZGXYskvwmEDYfN0kb1ncgYZ B+SE5Kwwe+hhokS00yXc8VLRBu4ROv0970y58ctAIPaXBxKALnb4342vKPmb7vM7scBx fq8rVWO8eLQy1dnFp/9TlnoC5ZFsrWivOdoTQUb2C2f21TBl7BDny9hUgN1sdjS9K4+A oEUMSYzX73YowapcwjuNPk2dP5PqDW3YZSZ9FVfNloBZ5VyOLUzFC8u4xwXuKOKDevjx EFpA== 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=8wq8asihVhIpgEZgIkNu7ws7QCW2/mN90Big/42PoaI=; b=rteWeMhsVgUn/cbjTR6b0bp986WzK39B+7YnqfyT3vuvG1VYhxhXHzrt7+w6wXZDkn 5PbuX4g19irtekhga1BYyamH8ockHJz8CCb1B4O+aXeQlDrP+OrmQm/JvlVYr4b2AfCf 6Qzcl92XgS5/8ZJx/PZXhwmkjqbS8humaALzFahTGOP8/Rbse6qsrXj6lORiADTAD976 hJVC/ItH3wlxsSSa2ZdQYZHIKg56+8LK9xjYNpGas7V/3b7sF29lJfBr+prvr1QUX1dK tQuX7FDkiay1aTcZbY2hs6wzS+pPEeRStfbjjgESjhh9l4LUOdW9+ZCmfRJ2KPmx6K2Q k80Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oLRq501n; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sd18si2418841ejb.534.2020.05.01.13.46.17; Fri, 01 May 2020 13:46:42 -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=@gmail.com header.s=20161025 header.b=oLRq501n; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726405AbgEAUqL (ORCPT + 99 others); Fri, 1 May 2020 16:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbgEAUqL (ORCPT ); Fri, 1 May 2020 16:46:11 -0400 Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A17C061A0C for ; Fri, 1 May 2020 13:46:11 -0700 (PDT) Received: by mail-oi1-x244.google.com with SMTP id 19so818238oiy.8 for ; Fri, 01 May 2020 13:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8wq8asihVhIpgEZgIkNu7ws7QCW2/mN90Big/42PoaI=; b=oLRq501nS9KMOU1dUPhEBpRJQIQ/DQycbOgmTPLkXc/VLsYWT5LrkSresV1EBIiRtm 6+mqoKGfA5ek5CFYTznWhvAAlPVTZHYJ9LCobKYJl7JRcrj4A76Og049doMH1SVwNBoE m1Lh+eekRzgmqjuoXFhpwh/XX3r14pfeu263VbL4QpM5nG9fC/cb2Nv4G31LT2g92/Ht Ldf7ZbRJGqB4yWrGiHB4KSE8YcarGjEi0R2A+7+vvIKH8TZ+RUn6j6VdHs9ZmS2DjuBi 5ZfVjQeHf5Gz30oAtNT8Xs7kzYMJiqT/3P+YEBEgo8Y7FITK2Cnxz1nyvWcbb+HiU8RY 0pDA== 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=8wq8asihVhIpgEZgIkNu7ws7QCW2/mN90Big/42PoaI=; b=NA1MyozJFiC2cFQoMUBrCcGSDoIip2kysWj3C6KkYYdO9lmaoie8Kycr3UARL9eBqN sM0CqGLDfMEoPiawN7Rqx1RbTRjXOYeOeP72h0NlYI1Ff+GmQ98BbAqhK8F7NfQi7dSz eOvcVpLQGBCBncsfGDG5jKwBNRszwQjildKwmGzvM3OO+ZCqkbvV2H8Hurg9UF01md3M cPTnwvT6VJ84TQMFgTcaCyMYksKd/NzaKvfaGpTSraE+CeNPsAFlIIN9wctnnUC10YfM 51XMvgZnj5NlCUDa32yHuIgUt5u9OgB1X6wj2EdKIYzT6rRK12rAAXkC1m/D1mAgGC5H kBFw== X-Gm-Message-State: AGi0PuZBtZlSXUTY/DndyQxDKRzkt7cI6IHXGvrcLfEIG2xUmxJvcLBD 05UeZ8PUYAuOq8VSmEQeHAn6HaeoCLvCj13qtXc= X-Received: by 2002:aca:b155:: with SMTP id a82mr1169887oif.110.1588365970363; Fri, 01 May 2020 13:46:10 -0700 (PDT) MIME-Version: 1.0 References: <20200501192218.73993-1-alainm@chromium.org> In-Reply-To: <20200501192218.73993-1-alainm@chromium.org> From: Luiz Augusto von Dentz Date: Fri, 1 May 2020 13:45:58 -0700 Message-ID: Subject: Re: [BlueZ PATCH v2] shared/gatt-client:Ignore orphaned characteristics To: Alain Michaud Cc: "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 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. -- Luiz Augusto von Dentz