Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1274299rwi; Mon, 10 Oct 2022 13:57:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UlVwxsBOM5fXJY54+F/WkZgHyF7+gvwluqgG6JeZCkGgwdpH0AQvujCA1pgG9GHiJIFs9 X-Received: by 2002:a17:903:228f:b0:181:3bec:9b9e with SMTP id b15-20020a170903228f00b001813bec9b9emr12852680plh.120.1665435446947; Mon, 10 Oct 2022 13:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665435446; cv=none; d=google.com; s=arc-20160816; b=KUiQFQ9kx65TzPkfKoOhCGREgeUbzeuibVf/MLLu2uFaDmtl6TPtTp3DC+uNRChc9p 4dghdsEVgSzz+9P665A2MYBsOXd+u0BEPlq03VsfHkoHwoW27YY1sUYOt4QWM2KYIX6j HI3vzaVXa+HxEMxbLlQ/rhLiqfNX5o7+16SYcDs4bxrvmnwh53w3H2ew2QaWYZ2BUvkJ 4rjhH96zP6vGV26rVMz3wmwobYDWhTLJBDP1SvheXwK9Dk9LiBixBcHUHQ6LeYzc2zxw peoGgK7mTGiILhGc1wRBiCj4RdPa0VHMwgu7NaA8emZDd+r2AlSHH7AyaVhYx7TbGJ2w 3bZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Fzjh91Y/JbnvimsyZf1livlw6wkkD3YS/xx1tu/nUH4=; b=08hr2LSCjpiNXLoyCDhVaban8ye6nMnBkcgfds6Z2Op2i2foDu7ae4O5OL9aM7el4g uhNfhrGsa11QOZ3cSUj2C3CqY84MmI7HXUm4XS7VaJIpuWQfPdPll78H0RBfowTEcPnJ vvsytJbkTZRpBFc4cNQ/815ULUvgX/ebzCJTHdnwqCrL5TkZ4zBIRJAwXtGBSoHTBMzC lVA3h3gRSsQOGHh4cT/3kij7G/REbYfWcAlxCfTzFXFlmwwTJIoM8Tnz4+hJawIBDW2e ih6Bmn8fe6rg9xjHDlGusLQeIwzd9091EhAmhIA5Qv8eeNvS6jdE0EMslEOzU7xi4zdx jJkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="RM/eGtbK"; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a23-20020a62bd17000000b005632d18cd91si6000326pff.263.2022.10.10.13.57.14; Mon, 10 Oct 2022 13:57:26 -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=@intel.com header.s=Intel header.b="RM/eGtbK"; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230181AbiJJUhN (ORCPT + 99 others); Mon, 10 Oct 2022 16:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbiJJUgk (ORCPT ); Mon, 10 Oct 2022 16:36:40 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E837DBF51 for ; Mon, 10 Oct 2022 13:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665434134; x=1696970134; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0sz9r/pAE+BRb15nd+4QZH7Cfu1rlGXnRZmwKYZeAcg=; b=RM/eGtbKzLAS4SDS5QDk2DeIHdrMJBqkldInvNQZUSPA4U6KCfFiATGQ Te4w8Hvjn+H48Zcf4ou0LEtc2Pmg/azL/FxNiui+A0mmNmjRmtCfRLP1f /Jc+zrl161wrXBbW4TiZBmo4AyqLSfOWmO6628zLmevQIq4C5+rv6XkrW ggaMbcfAPVAjmoMtRsKH7VA77rdvE7gbqefL6JpZJzsuW3OMc4/hTi8IC bfunc5Aou/YEPRgTv6JJ3B3T541R/TqM8Lt8cfPYFnqfYqWsZUCCIOuax QI+W5AN0+E3iWsVnNQAZnzyMPegXrm1fh/agrmzUBxm5eIKArm6wJDo2W w==; X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="330802909" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="330802909" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 13:35:30 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="730696023" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="730696023" Received: from yvasudev-mobl.amr.corp.intel.com (HELO bgi1-mobl2.amr.corp.intel.com) ([10.209.135.7]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 13:35:30 -0700 From: Brian Gix To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, brian.gix@intel.com, Luiz Augusto von Dentz Subject: [PATCH 2/2] Bluetooth: hci_sync: Fix not able to set force_static_address Date: Mon, 10 Oct 2022 13:35:22 -0700 Message-Id: <20221010203522.1251151-2-brian.gix@intel.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221010203522.1251151-1-brian.gix@intel.com> References: <20221010203522.1251151-1-brian.gix@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 From: Luiz Augusto von Dentz force_static_address shall be writable while hdev is initing but is not considered powered yet since the static address is written only when powered. Signed-off-by: Luiz Augusto von Dentz Tested-by: Brian Gix --- net/bluetooth/hci_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c index 3f401ec5bb0c..b7f682922a16 100644 --- a/net/bluetooth/hci_debugfs.c +++ b/net/bluetooth/hci_debugfs.c @@ -757,7 +757,7 @@ static ssize_t force_static_address_write(struct file *file, bool enable; int err; - if (test_bit(HCI_UP, &hdev->flags)) + if (hdev_is_powered(hdev)) return -EBUSY; err = kstrtobool_from_user(user_buf, count, &enable); -- 2.37.3