spi: spi-apple: Implement Runtime PM support#530
Open
gg582 wants to merge 1 commit into
Open
Conversation
Author
|
This makes a kernel panic...patching soon. |
Author
|
Tested on Apple MacBook Pro (13-inch, M1, 2020). done |
Member
|
Can you tell me how you tested it? |
Author
|
good question. first, the test result after pressing F2 at a touchbar: LogsScript#!/bin/bash
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "Error: Please run as root (sudo ./check.sh)"
exit 1
fi
# Find the spi-apple device directory
SPI_DIR=$(find /sys/bus/platform/devices/ -name "*.spi" | head -n 1)
if [ -z "$SPI_DIR" ]; then
echo "Error: apple-spi device not found in sysfs."
exit 1
fi
echo "=================================================="
echo "Target SPI Device: $(basename "$SPI_DIR")"
echo "Path: $SPI_DIR"
echo "=================================================="
# 1. Enable Dynamic Debug for Runtime PM and spi-apple
echo "Enabling dynamic debug logs..."
if [ -f /sys/kernel/debug/dynamic_debug/control ]; then
echo 'file drivers/base/power/runtime.c +p' > /sys/kernel/debug/dynamic_debug/control
echo 'file drivers/spi/spi-apple.c +p' > /sys/kernel/debug/dynamic_debug/control
echo "-> Dynamic debug enabled."
else
echo "-> Warning: /sys/kernel/debug/dynamic_debug/control not found."
echo " Make sure CONFIG_DYNAMIC_DEBUG is enabled in your kernel."
fi
# 2. Check current configuration
echo "--------------------------------------------------"
echo "Initial Runtime PM Configuration:"
echo "--------------------------------------------------"
if [ -f "$SPI_DIR/power/control" ]; then
echo "Power Control Mode: $(cat "$SPI_DIR/power/control")"
else
echo "Power Control Mode: N/A"
fi
if [ -f "$SPI_DIR/power/autosuspend_delay_ms" ]; then
echo "Autosuspend Delay : $(cat "$SPI_DIR/power/autosuspend_delay_ms") ms"
else
echo "Autosuspend Delay : N/A"
fi
echo "--------------------------------------------------"
# 3. Monitor state changes
echo "Starting real-time Runtime PM status monitoring..."
echo "Press [CTRL+C] to stop."
echo ""
echo "Timestamp | Status"
echo "--------------------------------------------------"
while true; do
STATUS=$(cat "$SPI_DIR/power/runtime_status" 2>/dev/null)
TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S.%3N")
if [ "$STATUS" != "$LAST_STATUS" ]; then
echo "$TIMESTAMP | $STATUS"
LAST_STATUS=$STATUS
fi
sleep 0.05
done |
Author
Author
|
A feature is okay after resume, no long delay when using touch bars...I will submit a full dmesg after fixing another PR's bluetooth power manager |
Signed-off-by: Lee Yunjin <gzblues61@gmail.com>
Author
underflow detected. Currently fixing |
Author
|
root@fedora:/home/yjlee# dmesg | grep apple-spi now clean...yes |
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.
Implementing Runtime PM support...
Just a small change