bluetooth: hci_bcm4377: Implement Runtime PM support#535
Open
gg582 wants to merge 1 commit into
Open
Conversation
78e1921 to
c7b72f1
Compare
Author
|
I guess this is affecting M1 2020 |
Author
|
This is still buggy... |
Author
Repetitive pm runtime enable caused an error. Patching... |
c7b72f1 to
a05fbe2
Compare
Author
|
Other mac series uses different broadcom chips. My device is Macbook Pro(M1, 2020) j293. I'll submit dmesg result and suspend/resume check after testing |
1e33ac0 to
00ec730
Compare
Signed-off-by: Lee Yunjin <gzblues61@gmail.com>
00ec730 to
aa5d485
Compare
Author
Script#!/bin/bash
# Check root privileges
if [ "$EUID" -ne 0 ]; then
echo "Error: This script must be run with root privileges (sudo)."
exit 1
fi
# Find bcm4377 PCI device address
PCI_ADDR=$(lspci -d :bcm4377 2>/dev/null | awk '{print $1}')
if [ -z "$PCI_ADDR" ]; then
# Fallback: find via driver symlink if lspci device ID matching fails
PCI_ADDR=$(basename $(readlink /sys/bus/pci/drivers/hci_bcm4377/* 2>/dev/null | head -n 1))
fi
if [ -z "$PCI_ADDR" ] || [ "$PCI_ADDR" = "drivers" ]; then
echo "Error: hci_bcm4377 device not found. Ensure the driver is loaded."
exit 1
fi
DEVICE_DIR="/sys/bus/pci/devices/$PCI_ADDR/power"
echo "Found device address: $PCI_ADDR"
echo "Power control path: $DEVICE_DIR"
echo "--------------------------------------------------"
# 1. Enable Runtime PM and set to auto
echo "[1/3] Setting Runtime PM control to 'auto'..."
echo "auto" > "$DEVICE_DIR/control"
sleep 1
# 2. Test Runtime Suspend (Idle state)
echo "[2/3] Waiting 3 seconds for the device to enter runtime suspend..."
echo "(Driver autosuspend delay is configured to 2000ms)"
sleep 3
STATUS=$(cat "$DEVICE_DIR/runtime_status")
echo "Current status: $STATUS"
if [ "$STATUS" = "suspended" ]; then
echo "Result: Runtime Suspend SUCCESS"
else
echo "Result: Runtime Suspend FAILED"
echo "Note: Ensure no active bluetooth sessions or processes are holding the device active."
fi
echo "--------------------------------------------------"
# 3. Test Runtime Resume (Force Wakeup)
echo "[3/3] Forcing device wakeup by changing control to 'on'..."
echo "on" > "$DEVICE_DIR/control"
sleep 0.5
STATUS_ON=$(cat "$DEVICE_DIR/runtime_status")
echo "Current status: $STATUS_ON"
if [ "$STATUS_ON" = "active" ]; then
echo "Result: Runtime Resume SUCCESS"
else
echo "Result: Runtime Resume FAILED"
fi
# Restore configuration to auto
echo "auto" > "$DEVICE_DIR/control" |
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.