Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2014827rwa; Sun, 21 Aug 2022 23:56:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR5jkdL9M4cjUnDUFpuUmtsteDLL2C+lVgK/FV5+QnEBimwcWHeUFAh0HH/17i9iqI1OEMqe X-Received: by 2002:a05:6402:1cab:b0:445:d67f:5323 with SMTP id cz11-20020a0564021cab00b00445d67f5323mr15271487edb.100.1661151365229; Sun, 21 Aug 2022 23:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661151365; cv=none; d=google.com; s=arc-20160816; b=obhizMI9fNVDz1UZ1liZn4rUqgqqduRjfPr2DUJe5pcm1IxqRyCd4+LUsOMh9vGQ4B lE/UZWYnSuCVqgIgxP07Gp6sW1GziSTY6Ik4+DTP/TkcL5qb4qfHSAwbuzoa2lFbaLgD wqxo9Osal3AcnUpp8EuVaxegaaSlt9hS/AWS1h6Q+zs7hPlhPp8JL0L16aFz8kZXuEaN c5EHBD5Jn+ucUrU2pUNT+2wVAvFqbWvas7LI7Bq+C+mRs+D71o03y1lJ8Z65E2ZRIUAx ejo5biaMsQxOpsrVgAYtv66oMEk7PK/CFIVqjnlzMEMErvnF4ofHwOJIZv46KP9DJNhg vxbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Z3NK4KAYHLC+fQ09iPERIBIy3dzNB36KR9aAr4JmPrA=; b=f73IsctvC5Yk3je2mh6DcQEU1ZkR1Sw82yT3tEpwlQkPdb0ahAveGIHzXnDtSPdIUt depc1mZMeq+E84igJWtnhULkZWZ7YGSDt6hO+iKdt4Ys83YsfFP3V8CjJH2e3woKn0V2 oe1QZ+2jKGyTnmnJPfAoZuqSQZ/ROWYIWwEIzuPYVTOUIVXn1zS7lZxdmLJvN9mS3Xs7 lCMkXJ13eyRoQkDdAACBaa3I5QGZfSC+CTiMPOt9ga4IqDk+yHRS7GWQUi1qBBgV0usC eBkjKgpS2qMWO8/UldAxjw4KHsjsT/UK8mqa0uj567+00U19UwZIl7s+bn7+7ZOoulDS x01A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=XPJVyeva; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q33-20020a05640224a100b00445f4337b07si8779354eda.362.2022.08.21.23.55.37; Sun, 21 Aug 2022 23:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=XPJVyeva; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232403AbiHVGtj (ORCPT + 99 others); Mon, 22 Aug 2022 02:49:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232764AbiHVGth (ORCPT ); Mon, 22 Aug 2022 02:49:37 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9FA8186CF for ; Sun, 21 Aug 2022 23:49:34 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id w19so19245856ejc.7 for ; Sun, 21 Aug 2022 23:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=Z3NK4KAYHLC+fQ09iPERIBIy3dzNB36KR9aAr4JmPrA=; b=XPJVyevazTQW9/uNdKowRPsHQZfaI6cfviMaX9DkU0+xxQ1O37n3neSwejzuJVyGgP RaIxJhXjsgRqW1r8vlyxofEblaA4RZIqkrT/sRAMag4Z/UH99ylGzut8tDUUbtl0HBFz 7ZDYZaqP2CSH/U4OIyr+AQoQ1MAP8ngPp3aPp2OlT1zKWbP1AUA36vKf4IdX/v3xgxtj z4uPHl/0pN54iA4qbkDnPqDr67cG6N/Zd01uu3S9BEEK9d6Y8ObuocfBS3uUOVAerdgF 1k3Rf6CqP5xfTx4Y7TW8B6Vcosfs1LAFIXqHuJXzyHMEm4m1uLGMpdcpkGZmQ1sOZBmp B1ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=Z3NK4KAYHLC+fQ09iPERIBIy3dzNB36KR9aAr4JmPrA=; b=mOYJXm3DozuDYWAYLP/JciI+2ee3fDm1lmRv7naIVpRQhwIBlCaehcRvG/Hwq24BoN Y115nvBIhUS8c3BXPCZi1zcBavPe9bV2DLETNwhYPcReSfICsM/4sEGZ0OfjanTK7WqD qCW7jVUeogQ9ZkFI7OCXIMWlGPHHDmW9z673PBI1JdDfTYgi2jH/234l8Wh68N4JEHtH +qaFg6A06R2z3OtMzg3CYsC82tlDSgRvRwiclfR+BusDU3wQOjQ2zy+Ova2GfPTATbwT RNZ6NiPxDAFPLC6XLeTdyaDa2HNdNAq3CX3fMrN9wOB/e0QcVwSFg0RH74TP8n+dP8/f ySvg== X-Gm-Message-State: ACgBeo0XtkVyv8/emkyEcdP1Xk9JgSJeTla8lOaneciInvUctRMTyLoE I3FiCcyny7TWQGsJpT0/xGNVhI1Q3y8KJZQDhC1J3Q== X-Received: by 2002:a17:906:ef90:b0:730:9af7:5702 with SMTP id ze16-20020a170906ef9000b007309af75702mr12150986ejb.107.1661150972793; Sun, 21 Aug 2022 23:49:32 -0700 (PDT) MIME-Version: 1.0 References: <20220822125221.Bluez.1.I541cbea9d6295f531c796bf3bda96b22db76bc19@changeid> In-Reply-To: From: Archie Pusaka Date: Mon, 22 Aug 2022 14:49:21 +0800 Message-ID: Subject: Re: [Bluez PATCH] adapter: Reset pending settings when receiving MGMT error To: Paul Menzel Cc: linux-bluetooth@vger.kernel.org, Luiz Augusto von Dentz , Marcel Holtmann , chromeos-bluetooth-upstreaming@chromium.org, Archie Pusaka , Sonny Sasaka Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Paul, On Mon, 22 Aug 2022 at 14:40, Paul Menzel wrote: > > Dear Archie, > > > Am 22.08.22 um 08:33 schrieb Archie Pusaka: > > > On Mon, 22 Aug 2022 at 14:15, Paul Menzel wrote= : > > >> Am 22.08.22 um 06:53 schrieb Archie Pusaka: > >>> From: Archie Pusaka > >> > >> I think the tag in the email subject needs to be [PATCH BlueZ] to be > >> detected by the build bot. > > > > Is the bot the one who just commented about the test result? If so > > probably it can detect this format as well. > > Yes, I noticed after hitting *Send*. > > >>> We set the pending settings flag when sending MGMT_SETTING_* > >>> commands to the MGMT layer and clear them when receiving success > >>> reply, but we don't clear them when receiving error reply. This > >>> might cause a setting to be stuck in pending state. > >> > >> Were you able to reproduce a problem on real hardware? > > > > I only received some reports, but unfortunately I cannot repro on real > > hardware. The symptom is BlueZ can't be turned off, snoop logs shows > > that MGMT_OP_SET_POWERED fails to be sent, and we are stuck with it > > since the next commands to toggle power are ignored. > >> > >>> Therefore, also clear the pending flag when receiving error. > >>> Furthermore, this patch also postpone setting the pending flag > >> > >> postpone*s* > > > > Thanks, will fix. > >> > >>> until we queue the MGMT command in order to avoid setting it too > >>> soon but we return early. > >> > >> Maybe add a comment, that how you tested this? > > > > The reporter claims the problem is no longer observable after this > > patch. I didn't do any other intelligent way of testing, > > unfortunately. Do I also need to document that? > > Is the bug report public. No, the bug report is filed by Vendor testing unreleased devices, so unfortunately it is not public. > > It=E2=80=99s not a requirement. I just thought, that the Chromium project= has a > big QA setup, and runs on millions of devices, it=E2=80=99d be good to kn= ow, for > example, if the patch was battle proven for several months in production > or if it=E2=80=99s verified by one person. Chromium usually holds the "upstream first" spirit, this patch is no exception. So, currently it is not battle proven. Whether accepted or not, we would still merge it to the Chromium tree though. If required, by that time I can circle back to this patch and report any future findings. > > > Kind regards, > > Paul > > > >> > >>> Reviewed-by: Sonny Sasaka > >>> > >>> --- > >>> > >>> src/adapter.c | 45 +++++++++++++++++++++++++++++++++++++-------- > >>> 1 file changed, 37 insertions(+), 8 deletions(-) > >> > >> [=E2=80=A6] Thanks, Archie