bluetooth: hci_bcm4377: Implement Runtime PM support#535
Conversation
78e1921 to
c7b72f1
Compare
|
I guess this is affecting M1 2020 |
|
This is still buggy... |
Repetitive pm runtime enable caused an error. Patching... |
c7b72f1 to
a05fbe2
Compare
|
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
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" |
|
|
@WhatAmISupposedToPutHere It seems okay, please kindly review this when you have enough time |
|
@WhatAmISupposedToPutHere Hi, I noticed that you closed my previous pull request as an AI slop. I agree that SPI problem would not actually solve a problem, but this will actually help power suspension. I hope that you are not tagging this as an AI slop too. If you are okay with closing it, I appreciate it. |
|
Isn't this one already in upstream linux? Just send it to LKML directly |
|
Okay, lemme send this to the upstream branch, thanks. Basically this is just a patch for bcm4377.. |
|
I've submitted the patch to LKML with the title: Thanks for the guidance. |
No description provided.