From patchwork Wed May 31 08:57:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13261770 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5C81C77B7C for ; Wed, 31 May 2023 08:58:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235232AbjEaI6l (ORCPT ); Wed, 31 May 2023 04:58:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231397AbjEaI6k (ORCPT ); Wed, 31 May 2023 04:58:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30D7210B; Wed, 31 May 2023 01:58:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BA6196311E; Wed, 31 May 2023 08:58:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F257C4339B; Wed, 31 May 2023 08:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685523518; bh=HaYbQJNi6y881NqAy/tkhEXGqgb8cgiQ7a1/RH6TbrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sKwl+ueYa9OKC0VTzsZZm6QE+TtD+wHKIUCr/INiDLgF9vK6gK8Vasyu9RcSI3gQZ LdtJqjpTS1zuKkZpNXCRo9G8VN8UXcQr4mlVr2eUKYaoou5OrMPDYpAZEjbtdUmKVt 2zCOrSE25apXdIFqkxTGpx9DkmYCTp4hGmKQoUOmp7ZCbtcOpzG/HsgrkpQiHtQADx Ow8qtQehHdWoom1OUMwbf28DlkfGWVPmv7xWFRrUeHJMef7gyixk4v6mjUfoh9KdVx XBzNsuWeNTO9es6qJEjFKLBfcxPS8Zh5He0Z4ObGWuO8wBS6+4Ja09/edT+95W6qYv B4BwUqWcWuDtw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1q4HfF-0000jn-Oe; Wed, 31 May 2023 10:58:41 +0200 From: Johan Hovold To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH RESEND 2/2] Bluetooth: hci_qca: fix debugfs registration Date: Wed, 31 May 2023 10:57:59 +0200 Message-Id: <20230531085759.2803-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230531085759.2803-1-johan+linaro@kernel.org> References: <20230531085759.2803-1-johan+linaro@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Since commit 3e4be65eb82c ("Bluetooth: hci_qca: Add poweroff support during hci down for wcn3990"), the setup callback which registers the debugfs interface can be called multiple times. This specifically leads to the following error when powering on the controller: debugfs: Directory 'ibs' with parent 'hci0' already present! Add a driver flag to avoid trying to register the debugfs interface more than once. Fixes: 3e4be65eb82c ("Bluetooth: hci_qca: Add poweroff support during hci down for wcn3990") Cc: stable@vger.kernel.org # 4.20 Signed-off-by: Johan Hovold --- drivers/bluetooth/hci_qca.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 1b064504b388..e30c979535b1 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -78,7 +78,8 @@ enum qca_flags { QCA_HW_ERROR_EVENT, QCA_SSR_TRIGGERED, QCA_BT_OFF, - QCA_ROM_FW + QCA_ROM_FW, + QCA_DEBUGFS_CREATED, }; enum qca_capabilities { @@ -635,6 +636,9 @@ static void qca_debugfs_init(struct hci_dev *hdev) if (!hdev->debugfs) return; + if (test_and_set_bit(QCA_DEBUGFS_CREATED, &qca->flags)) + return; + ibs_dir = debugfs_create_dir("ibs", hdev->debugfs); /* read only */