Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2002294rwa; Sun, 21 Aug 2022 23:34:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR7SenZemEpvxaPXPlrXh/xKE9yd4WQgJ3yp3M4L9U/vmQENRAccb+vM3PzZnG79eG0rRv6O X-Received: by 2002:a05:6402:447:b0:440:d482:495f with SMTP id p7-20020a056402044700b00440d482495fmr15367735edw.264.1661150060374; Sun, 21 Aug 2022 23:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661150060; cv=none; d=google.com; s=arc-20160816; b=SXBfV1/5o1FxDg9p8V530bVI8l6cS0zN+PBe/7FkZQ9MinsdoVnVjSNCIrp/G0F0R4 mB3dFlqW01bVcrP/usKbSHvZ4N7WV2lR1Xfx0ql0e/0qsoIX4HibuV+0uX6MJuYHcDFt ED7uQKPb4DXO3hZyIGK0Z0hcC9YYxXsGrgGZ7mjfihI37uBzJmalHHEj1IUTHxIYHc2u WlVqFP7E/s9d691vG5Qvy/JDK+4sZkTA8s7RNs9a5DRkMXEaVAHVl1hqEX9gAXhmNtW1 1CRZb1tChEPJRRExrqCLHyG8ImtzW+d8RbJDAwlFm3/BXyaUgTSF/HAA9y6Rc5kgXVnI kg4g== 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=PDsAXXb1G3Kq7+/mrPkqVdRRmqJVAsQ2L5qvxuquj2c=; b=dN2DjbJUGce3N93wR+0IVpW+eG8xG9mXXdfV+Kkluaf+1nMgIUPkk/4KI1u1gn+G1C D1WgzCpioA6rBAB9f0nW4/GVg7pm40abxcD84ecXvdfWakeN3aU6FGNbek9Eq1pDZpTe 0cRquWNnmyyQ7iqrXHg1tDpMUtFeKrd4C3KUBY29dTypPAsud9IUBZgGz4/uBMiYfJdo S+T1JIuibIuaMufIOHidNItck/7gU2vrEPAFmSq/45rZi77vcrLZATbvO/VjgCju4ZIc iO1KAAsVY0fu7Cbq31VfKLbA70i6yK6NYzQolQ/BB0lqOK1iDGB5yLdrFhCgP8fov6a4 Ft9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Dglx+iEx; 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 qw37-20020a1709066a2500b0073111225ba5si9668300ejc.743.2022.08.21.23.33.51; Sun, 21 Aug 2022 23:34:20 -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=Dglx+iEx; 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 S233040AbiHVGdq (ORCPT + 99 others); Mon, 22 Aug 2022 02:33:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233036AbiHVGdp (ORCPT ); Mon, 22 Aug 2022 02:33:45 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2041EBF76 for ; Sun, 21 Aug 2022 23:33:44 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id gi31so12696414ejc.5 for ; Sun, 21 Aug 2022 23:33:44 -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=PDsAXXb1G3Kq7+/mrPkqVdRRmqJVAsQ2L5qvxuquj2c=; b=Dglx+iExc1Cw6YPHHiPc7AY3azPiFZCkc8sW4UC/CH2tpmQaVusGOGFRuaV4F70J4l tR5p3WYN3GApi6PBB9A+fdHvVenPMHqr5I7u15w7AwoVVMqYASTXjpQL/fzngBhQajUu jEvxY3i6PqlvZtMddIG9z8ElmCYfqshrWPKambYIoGqbhwxjbYWLK9WA4ZMjFrN/75w/ M1t8+U1YtrDz7ZZjCH4urp6PUrtuzNks9p/M5WRlgn2vvtET2V4XZ7/1Iqy6BXbg1NTg B7wSmEHJ1pg7YUss0b+lpNh9MC5SngBMhSZHfZt97Em42gU9CRZeq8GSup6beg8SJXTG XAYg== 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=PDsAXXb1G3Kq7+/mrPkqVdRRmqJVAsQ2L5qvxuquj2c=; b=8BfRbiFeV7RfK2VHXAN/0Jl4Lduc3o11vuOHMhGHFYlgEt80tJf5zdz/pyH2kwY7Hr asmO+5/zKrqs1UVL1mhw9qDTTYvOyggDtD3yReBHX+Kz8UorjHAHIMYF530dVDjgsviM /C3BW444qtEdbAjO0DqaI0bzjFxMtHsxoT8MOSsVRSUYRm1W1DELq92OTt1lLEUaSzZQ boXBU+zFl1+pEPHPoOrJ4VstIP/IG6j2GN94N1GaiTZ6cE3lht5XDYIYd+cmBeh1UsTf em2PKKeKMPe1EIDHB0GbW5zvHYQgaUap2pFpPn2a7Hen4aorIishZiO9bBqHrMwmW2mj 7nOA== X-Gm-Message-State: ACgBeo3cvH7jPFKNuDE6bZh2uWN3pP6sBLy+JvIas3x2ysc84vSc8qaq C07MB0AQFc2dzkmpZxOx7HKI6b1bOLhxhVDME+9mWg== X-Received: by 2002:a17:906:ef90:b0:730:9af7:5702 with SMTP id ze16-20020a170906ef9000b007309af75702mr12117411ejb.107.1661150022431; Sun, 21 Aug 2022 23:33:42 -0700 (PDT) MIME-Version: 1.0 References: <20220822125221.Bluez.1.I541cbea9d6295f531c796bf3bda96b22db76bc19@changeid> In-Reply-To: From: Archie Pusaka Date: Mon, 22 Aug 2022 14:33:31 +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:15, Paul Menzel wrote: > > Dear Archie, > > > Thank you for the patch. > > > 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. > > > 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? > > > Reviewed-by: Sonny Sasaka > > > > --- > > > > src/adapter.c | 45 +++++++++++++++++++++++++++++++++++++-------- > > 1 file changed, 37 insertions(+), 8 deletions(-) > > [=E2=80=A6] > > > Kind regards, > > Paul