Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2884894rwa; Mon, 22 Aug 2022 16:08:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/1xTU4KBy25qu4MFsnjXYeu8rFQuOhP5ceENWyD4M+79ojOXbHqLudxXkJjOelvjVmqmY X-Received: by 2002:a17:90a:df02:b0:1fa:ba39:ec49 with SMTP id gp2-20020a17090adf0200b001faba39ec49mr536975pjb.129.1661209711536; Mon, 22 Aug 2022 16:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661209711; cv=none; d=google.com; s=arc-20160816; b=YrEXfYrrXMJyJNBIPUpEzFUPlSZcK0/seZkKbi2IWbKdSaK1iBOX3ukgN0I3p2akBw oypHE48YhFAekg6AuS/f/8imUO+sJerm8+Jmk3cL+uVE+l07lrmg+6qjicXMHxu5bsdj WfC6TMKzetf+wCgiwspu5Vtmw5013p8M9+TMRUPPfscTv/UuZIOHk7OSjGzg0aJPP10e PFwa1i6BEtqe8+PLaw5UOR/NQj4cAMWQf/ZWtLvOXm/knNUl9LwMsoac9VOUr6jEqfLO ozN8WjUV3c0X8o3IpV2Zg46GRB3OWAF122UM8iTRXOQcvySQ0CcZzm32J2YxAJgX/7rS CbFg== 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=6IsETC87mxfK7/5VhKSNRp3ZonXwfy637BHG/csxGBI=; b=yKUFt5s+EMMJfCBKOveVPeQHSXyoHn082Vdp1vd/v/mTitkybY+WxNvsC7IfOxAPLl C7xnsX011GNHUPeheLrSdhzM958ZTHEKx43eXfmA/JJPstRbJj5oikeHb6scAf3eZjoA PifT96z0x0zj9L5WxNbj4Hf2AyJ6o3985iG3tNB2vwTddLEF2KjzXBpRYdARm9vJn1RT RjJiiA6OHq1/rQUoobxYu6aVoX+tfoH3SkvYu6nyBQTGjcMFoAYNul9Ys3IhyRSBVHp/ VA+8NOobBui5uUbzXWu9b5oQ8cUtTYTNU7WA9V5zTU+1nQAOYVbMHnE0JWOlKqtXkZKm F4/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WxyUh0PL; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v128-20020a626186000000b0052b8a12a057si12621115pfb.287.2022.08.22.16.08.19; Mon, 22 Aug 2022 16:08:31 -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=@gmail.com header.s=20210112 header.b=WxyUh0PL; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238201AbiHVWyN (ORCPT + 99 others); Mon, 22 Aug 2022 18:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230393AbiHVWyK (ORCPT ); Mon, 22 Aug 2022 18:54:10 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78ED52B251 for ; Mon, 22 Aug 2022 15:54:08 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id x10so11983339ljq.4 for ; Mon, 22 Aug 2022 15:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=6IsETC87mxfK7/5VhKSNRp3ZonXwfy637BHG/csxGBI=; b=WxyUh0PLFfEOaZM8QVR/gZ7Q/65aTg3gn0+DbSDeNYTngNlUosbiFPrVgpV9QLSdQe 1TZ4FvPpcyp9fx5r+DKt2cbEzfmpmrBeZ1G+x49xDy4C86jXUAjeL9Za2VXYJ70qfw80 E20rzTMrm4A/SAd0zr40SKyobIj5j4pxj7TBZqtIXhtaEcc3T5OKpBeZIMC7x5hAJ/GR NZSAj1y97HHXfYaKawwUR5um7mAAIpFEfkqrQZiTXnmYrXPLu9dYVgOEgIdQZCZfdOR0 nCKHIe79qJUSNl84S5WbZ0k7BNZb+xXhThiR6cjcLYBqCWFILNt7a3oUQFI+q4eqaFWO YvyQ== 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=6IsETC87mxfK7/5VhKSNRp3ZonXwfy637BHG/csxGBI=; b=2wraDArgjeKb6u+63jo953E9mKWZjBvutyhRhI+h5q3vPlhVHid4gruHKSMZcpqsLO d+E5UZLtECkiwS14bxlLPIIBibA/KYn5zaLd7Qk4AX/yV8pPQjt6nOceTpVWfX382GUU zBoWe3EI+kVY6hC8Kgw8Upg1IDAvaZ2hLUPVOnDV4+EmaFhqtnT6upP34uGxO1qD7YY2 Cu9GyfpEEeV2kKkcJtUvx69NcNfLPxcyaxlMFrBS0CdQe2fSs36f8sRO6qy7ODPzIGN6 sk82aaJzF0CLNJjTsgOOenX8DIpsVsrOMfhcZZU9Js0kje1bKNfhlQrJ6tZeL4rTebPW DSEw== X-Gm-Message-State: ACgBeo2YcYqtplTwWCmu8sMsh8X+YaSahh5R0hus+sB2qhQpY+2x4ux2 EQ5xZnXwBWuioO/RATcUfg5SHv5SDXtGGatkqro= X-Received: by 2002:a2e:8497:0:b0:261:cbd8:2348 with SMTP id b23-20020a2e8497000000b00261cbd82348mr2258118ljh.423.1661208846817; Mon, 22 Aug 2022 15:54:06 -0700 (PDT) MIME-Version: 1.0 References: <20220822125221.Bluez.1.I541cbea9d6295f531c796bf3bda96b22db76bc19@changeid> In-Reply-To: From: Luiz Augusto von Dentz Date: Mon, 22 Aug 2022 15:53:55 -0700 Message-ID: Subject: Re: [Bluez PATCH] adapter: Reset pending settings when receiving MGMT error To: Archie Pusaka Cc: Paul Menzel , "linux-bluetooth@vger.kernel.org" , Marcel Holtmann , ChromeOS Bluetooth Upstreaming , Archie Pusaka , Sonny Sasaka Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Archie, On Sun, Aug 21, 2022 at 11:33 PM Archie Pusaka wrote: > > 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. Weird how can you tell MGMT_OP_SET_POWERED fails to be sent or you meant it was sent but the kernel returned an error? It would be great to include these errors. > > > > > 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 --=20 Luiz Augusto von Dentz