Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare 14.0.rc2 #3694

Merged
merged 5 commits into from
Nov 22, 2024
Merged

Prepare 14.0.rc2 #3694

merged 5 commits into from
Nov 22, 2024

Conversation

sairon
Copy link
Member

@sairon sairon commented Nov 22, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced handling of data partitions based on system variant for improved functionality and maintainability.
    • Added support for Cypress M8 USB serial devices.
  • Improvements

    • Streamlined SDIO interface capabilities for the Raspberry Pi Compute Module 5.
    • Updated versioning from "rc1" to "rc2" to reflect the progression in the release candidate stage.
  • Bug Fixes

    • Adjusted regulator settings for SDIO1 to align with the latest specifications.

RubenKelevra and others added 5 commits November 22, 2024 14:25
Vendor ID: 152d
Product ID: a583

fixes #3674

(cherry picked from commit a042dc0)
If HAOS on Yellow is booted for the first time with NVMe data disk present, it
should be preferred over the empty eMMC data partition. This will ease
reinstall of the system and migration from CM4 to CM5. All other data disks
(e.g. if a USB drive is used for them) are still treated as before, requiring
manual adoption using the Supervisor repair.

(cherry picked from commit 98ac7f0)
Sync the DTS with changes added in newer commits merged after the initial
Yellow/CM5 DTS was written. The sdio1 node now has HS400 mode enabled and
sd_io_1v8_reg has been changed to regulator-fixed.

(cherry picked from commit b288cd2)
Build cypress_m8 driver as module for all targets - some of them had it in
their base defconfig while some not. It is required e.g. for UPB PIM (Powerline
Interface Module).

Fixes #3690

(cherry picked from commit d57e507)
Copy link

coderabbitai bot commented Nov 22, 2024

📝 Walkthrough

Walkthrough

The changes include modifications to several configuration files and scripts for the Raspberry Pi platform. The cmdline.txt file was updated to append a USB storage quirk. A device tree patch for the Raspberry Pi Compute Module 5 was made to synchronize SDIO1 settings and update regulator properties. The kernel configuration files saw the introduction and removal of USB serial support for the Cypress M8 driver. Additionally, the versioning was updated in the meta directory, and a script for handling data partitions was refactored for improved functionality based on the system's variant.

Changes

File Change Summary
buildroot-external/board/raspberrypi/cmdline.txt Appended 152d:a583:u to usb-storage.quirks parameter.
buildroot-external/board/raspberrypi/yellow/patches/linux/0017-... Updated sd_io_1v8_reg and sdio1 nodes in DTS for CM5: changed regulator type, adjusted voltage settings, and added enhanced features.
buildroot-external/kernel/v6.6.y/device-support.config Added CONFIG_USB_SERIAL_CYPRESS_M8=m for Cypress M8 USB serial driver support.
buildroot-external/kernel/v6.6.y/kernel-arm64-rockchip.config Removed CONFIG_USB_SERIAL_CYPRESS_M8=m; updated various configuration options for enhanced hardware support.
buildroot-external/meta Updated VERSION_SUFFIX from "rc1" to "rc2".
buildroot-external/rootfs-overlay/usr/libexec/haos-data-disk-detach Refactored script to improve data partition handling based on VARIANT_ID, added disable_data_partition function.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Script
    participant eMMC
    participant NVMe

    User->>Script: Detect data partitions
    Script->>Script: Check VARIANT_ID
    alt VARIANT_ID is "yellow"
        Script->>eMMC: Identify eMMC data partition
        Script->>NVMe: Identify NVMe data partition
        alt Both partitions found
            Script->>eMMC: Disable eMMC partition
        else Only eMMC found
            Script->>eMMC: Keep eMMC partition enabled
        else Only NVMe found
            Script->>NVMe: Keep NVMe partition enabled
        end
    else VARIANT_ID is not "yellow"
        Script->>Script: Disable non-root data partitions
    end
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
buildroot-external/board/raspberrypi/yellow/patches/linux/0017-ARM-dts-bcm2712-yellow-Sync-sdio1-and-sd_io_1v8_reg-.patch (1)

1-50: Consider implementing a comprehensive testing strategy.

Given the significant changes to both voltage regulation and SDIO capabilities, consider:

  1. Documenting the test scenarios that validate these changes
  2. Creating a test matrix covering different hardware configurations
  3. Adding regression tests to catch any future compatibility issues

Would you like assistance in creating a test plan template or documentation structure for these hardware changes?

buildroot-external/rootfs-overlay/usr/libexec/haos-data-disk-detach (1)

23-45: Handle potential failures in device enumeration

In the loop over datapartitions, the script assumes that datadev will always be determined successfully. Consider adding a check to ensure that datadev is not empty before proceeding with the case statement to prevent unexpected behavior if lsblk fails.

Apply this diff to add the check:

 for datapart in ${datapartitions}; do
     datadev=$(lsblk -no pkname "${datapart}")

+    if [ -z "${datadev}" ]; then
+        echo "Unable to determine parent device for ${datapart}, skipping..."
+        continue
+    fi

     case "${datadev}" in
         mmc*)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 885f0a8 and 9153203.

📒 Files selected for processing (6)
  • buildroot-external/board/raspberrypi/cmdline.txt (1 hunks)
  • buildroot-external/board/raspberrypi/yellow/patches/linux/0017-ARM-dts-bcm2712-yellow-Sync-sdio1-and-sd_io_1v8_reg-.patch (1 hunks)
  • buildroot-external/kernel/v6.6.y/device-support.config (1 hunks)
  • buildroot-external/kernel/v6.6.y/kernel-arm64-rockchip.config (0 hunks)
  • buildroot-external/meta (1 hunks)
  • buildroot-external/rootfs-overlay/usr/libexec/haos-data-disk-detach (2 hunks)
💤 Files with no reviewable changes (1)
  • buildroot-external/kernel/v6.6.y/kernel-arm64-rockchip.config
✅ Files skipped from review due to trivial changes (2)
  • buildroot-external/board/raspberrypi/cmdline.txt
  • buildroot-external/meta
🔇 Additional comments (6)
buildroot-external/board/raspberrypi/yellow/patches/linux/0017-ARM-dts-bcm2712-yellow-Sync-sdio1-and-sd_io_1v8_reg-.patch (3)

1-17: LGTM! Well-structured patch with clear commit message.

The patch header follows best practices with proper formatting and a clear explanation of the changes.


42-50: Verify signal integrity for new high-speed modes.

The addition of HS400 mode and enhanced strobe support will enable higher performance, but please ensure:

  1. The PCB design supports these high-speed modes
  2. Signal integrity has been validated at these speeds
  3. Proper testing has been done with actual eMMC devices

Consider documenting the maximum supported speeds and any hardware requirements in the documentation.


25-39: Verify the impact of removing voltage switching capability.

The change from a GPIO-controlled regulator to a fixed 1.8V regulator removes the ability to switch to 3.3V. While this aligns with the CM5 DTS, please verify:

  1. That all connected devices support 1.8V operation
  2. That removing the 3.3V option won't break compatibility with any existing hardware
✅ Verification successful

Voltage regulator change is intentionally aligned with CM5

The patch clearly shows this is an intentional synchronization with the vanilla CM5 device tree. The changes are part of making the Yellow's DTS consistent with CM5, where SDIO1 is specifically configured for 1.8V operation with enhanced capabilities (hs400-1_8v and enhanced-strobe support). The removal of voltage switching is deliberate as the hardware is designed to operate at 1.8V, not a compatibility concern.

Key evidence from the patch:

  • Commit message explicitly states: "SDIO1 and its 1V8 regulator have been changed in vanilla CM5 device tree"
  • SDIO1 node shows enhanced 1.8V-specific capabilities being added
  • Changes are signed-off by maintainer
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any references to 3.3V operation or voltage switching in documentation and other DTS files
echo "Searching for voltage references in documentation..."
rg -i "3\.3\s*v|3300\s*mv" --type md

echo "Checking other DTS files for similar regulator patterns..."
rg "sd_io_1v8_reg|vdd-sd-io" --type dts -A 5

Length of output: 355


Script:

#!/bin/bash
# Search for voltage references in device tree files with .dts and .dtsi extensions
echo "Searching for voltage references in DTS files..."
fd -e dts -e dtsi -x rg -l "3\.3\s*[vV]|3300000|vdd-sd-io|sd_io_1v8_reg" {}

echo "Checking patch content and context..."
fd -g "*0017-ARM-dts-bcm2712-yellow-Sync-sdio1-and-sd_io_1v8_reg-*" -x cat {}

# Look for related patches that might provide context
echo "Checking for related patches..."
fd -g "*bcm2712*" -g "*.patch" -x grep -l "sd_io|regulator|sdio" {}

Length of output: 2239

buildroot-external/kernel/v6.6.y/device-support.config (1)

16-16: LGTM! The Cypress M8 USB serial driver is properly configured.

The driver is correctly configured as a module, consistent with other USB serial drivers in the configuration.

Let's verify that this driver is enabled across all kernel configurations as mentioned in PR objectives (#3693):

buildroot-external/rootfs-overlay/usr/libexec/haos-data-disk-detach (2)

47-50: Correctly prioritize NVMe data partition over eMMC

The logic correctly disables the eMMC data partition when both eMMC and NVMe data partitions are present on the Yellow device, ensuring that the system uses the faster NVMe data disk as intended.


52-61: Maintain standard data disk handling for other variants

The script preserves the existing behavior for non-Yellow variants by disabling external data disks that do not match the root device, which is appropriate.

Comment on lines +15 to +17
disable_data_partition() {
e2label "${1}" hassos-data-dis
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Ensure error handling in disable_data_partition function

The disable_data_partition function does not check the exit status of the e2label command. To enhance the robustness of the script, consider adding error handling to ensure that the label change was successful.

Apply this diff to add error checking:

 disable_data_partition() {
     e2label "${1}" hassos-data-dis
+    if [ $? -ne 0 ]; then
+        echo "Failed to disable data partition ${1}" >&2
+        exit 1
+    fi
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
disable_data_partition() {
e2label "${1}" hassos-data-dis
}
disable_data_partition() {
e2label "${1}" hassos-data-dis
if [ $? -ne 0 ]; then
echo "Failed to disable data partition ${1}" >&2
exit 1
fi
}

@sairon sairon merged commit 9153203 into rc Nov 22, 2024
23 checks passed
@sairon sairon deleted the prepare-14.0.rc2 branch November 22, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants