From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12EC4606A31C for ; Mon, 30 Nov 2026 03:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Jy0lSkSn; dkim=pass (2048-bit key) header.d=archive.org header.i=@archive.org header.a=rsa-sha256 header.s=google header.b=b3FkolcK DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=1EzjSRhkqZmD792a/JryL2FUwDstHJ+iFZg9MAcqPsY=; b=Jy0lSkSnDr5V0G T9GvIos/xapkxuvGW460fITqd1kwPIIJQKtbWA/PfRnNqroklqawlqNkf4gqDMRxEaouythch+3tS LtQ4nZuxkcmHA9Z6ZwG93b8knlhxxZdSXwrkS2NlwXmBkW9720llgq/jrhjBRfdE82fdxo/l/ggVl WoWyI7WKZjYwa1QoANZVUYA9v8XWcwH1DA1CbPrFxqOncs0M03go8aIdv7b8dPqeg0la2G30fOnJS D3sNb0ZKbVbNJ2cAOqJu3I1Z5W9GWrG7tYcuZ6KCvyC2v7B2hVqiFoHQ6IoiVNoMYPNDqUH5OxcaX oFdSl/DTj4erB6RdL5/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXs2N-000000036p1-0Az0; Mon, 30 Nov 2026 03:26:43 +0000 Received: from mail-dy1-x132b.google.com ([2607:f8b0:4864:20::132b]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXs1v-000000036fH-0gK3 for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2026 03:26:18 +0000 Received: by mail-dy1-x132b.google.com with SMTP id 5a478bee46e88-380c28f9e35so10911033eec.1 for ; Sun, 29 Nov 2026 19:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archive.org; s=google; t=1796009174; x=1796613974; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1EzjSRhkqZmD792a/JryL2FUwDstHJ+iFZg9MAcqPsY=; b=b3FkolcK4T9N29GGTNi3r7tNz5ZaECkIzSINlj/C/IVENh+t6Y3pTSX+XQGKTnNA9K uHeEfeNJWRSkQx1ucPFFnZXUzLqV66RzvdoRabPjJaQEepZj5czniNJE7L0arC8rNaiJ ArpGqHLYlY/702jg6wqVgxRzhyu3B+2/eBXrWAgdQJUC1hvDFeDajGGu573LRQ5ZX3/H WktvsXcVH7wjbYqiHDNfgJZdXUQz1YCKCEe9kKly5qAyVFN618FjAhIm3HvkP631nikH ON/p3mQSO1xWPBLpppE8nNbnGB4VuJxqhkXKJMtwZzr4wooGwRP20Yq/u5vWguvc1xN/ WkRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796009174; x=1796613974; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=1EzjSRhkqZmD792a/JryL2FUwDstHJ+iFZg9MAcqPsY=; b=IOsYYspZwWM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Pa6Io6/edOV785aDzHaHW/D2xAtLLgYYWM7MtwBEaaQcheLOj8wH1o jIvVZQqPiTFQ2CHqcDF4Xxm175Vjq8TM8J72dfE7PxL3Ocses5z/2ARdHIylfk4R/dblnnK+Pnd Pt0mlQyyXYwalyPPdgQF2wix X-Received: by 2002:a05:7022:4181:b0:14a:a6dc:9cbf with SMTP id a92af1059eb24-1b5568abf0bmr43579250c88.4.1796009174316; Sun, 29 Nov 2026 19:26:14 -0800 (PST) Received: from omarchy ([98.47.114.6]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b55ff0e4e6sm66048806c88.11.2026.11.29.19.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 19:26:13 -0800 (PST) From: Raymond Berger To: dev@deq.rocks Cc: Sven Peter , Marcel Holtmann , Luiz Augusto von Dentz , Janne Grunau , Neal Gompa , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/3] Bluetooth: hci_bcm4377: keep ASPM off only while the firmware boots Date: Sun, 29 Nov 2026 19:25:06 -0800 Message-ID: <20261130032506.27039-1-ray.berger@archive.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261127132501.262651-4-dev@deq.rocks> References: <20261127132501.262651-1-dev@deq.rocks> <20261127132501.262651-4-dev@deq.rocks> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261129_192615_220871_9BD511F1 X-CRM114-Status: GOOD ( 16.02 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Fri, Nov 27, 2026 at 02:25:01PM +0100, Andre Eikmeyer wrote: > static void bcm4377_disable_aspm(struct bcm4377_data *bcm4377) > { [...] > + pcie_capability_read_word(bcm4377->pdev, PCI_EXP_LNKCTL, > + &bcm4377->link_ctl); > pcie_capability_clear_word(bcm4377->pdev, PCI_EXP_LNKCTL, > PCI_EXP_LNKCTL_ASPMC); > } [...] > @@ -2425,6 +2436,9 @@ static int bcm4377_probe(struct pci_dev *pdev, const struct pci_device_id *id) > if (ret) > return ret; > > + if (bcm4377->hw->disable_aspm) > + bcm4377_restore_aspm(bcm4377); > + I think ASPM can end up off for good when a probe fails between these two. Any error return between bcm4377_disable_aspm() and bcm4377_restore_aspm() (enabling the device, BAR mapping, OTP read, IRQ setup, firmware boot, RTI setup) leaves ASPM cleared in LNKCTL. The next probe, after a rebind or a reload, saves that cleared value and later "restores" it, so ASPM stays off until reboot. Restoring the saved value on the error paths, for example with a devm action registered right after bcm4377_disable_aspm(), would avoid that. I haven't written or tested such a change. Failed probes do happen on this MacBookAir9,1. With all three patches, Bluetooth hung during setup on most boots, and on the rebinds that followed, probes often failed with -110 (firmware boot timeout) before one succeeded. On those boots lspci showed ASPM disabled on the Bluetooth function afterwards; after a clean probe it shows L1 enabled. The timeouts themselves came from outside this series: brcmfmac's probe reset the whole chip while hci_bcm4377 was still starting, because my distribution loads hci_bcm4377 first. Loading it after Wi-Fi is up fixed that (50 of 50 clean boots, 10 of them with all three patches). ASPM on the Bluetooth function is what moves the package C-state here. Idle, with its ASPM bits cleared by hand (setpci) and then restored to what 3/3 leaves, each pair measured back to back in one boot: AC, screen on: PC3 28%, 2.49 W -> PC6 22%, 1.97 W (package) AC, screen off: PC3 55%, 1.51 W -> PC6 54%, 0.90 W (package) battery, screen off: PC3 54%, 1.45 W -> PC6 53%, 0.93 W (package) 3.35 W -> 2.67 W (whole system, discharge) Your commit message says this model reaches PC8; here it stops at PC6 (PC7 to PC10 stayed at 0 where I logged them). Did your PC8 run include other changes? With ASPM actually on (after a clean probe; in my earlier runs failed probes had left it off), resumes with all three patches were fine apart from the rtcwake one in my 2/3 reply: 7 of 7 with Bluetooth unbound around suspend from userspace (ASPM on again after each), and 8 of 8 that went through the re-probe from 2/3, alternating ASPM on and off before suspend. That's too few to rule ASPM out, but it doesn't seem to trigger that failure by itself. Tested-by: Raymond Berger I used Claude Opus 5.5 to help run these tests. It spotted this issue while going through the code.