Skip to content

Conversation

@Avenger-285714
Copy link
Member

@Avenger-285714 Avenger-285714 commented Apr 26, 2025

This commit was generated by rebasing all out-of-tree code from this repository onto a clean linux-6.6.y repository and then creating a diff against the current repository.

Aside from some minor non-semantic changes, other differences require further review.

Also, the content of PR489 is still being ignored.

Link: #489
Link: https://github.com/opsiff/UOS-kernel/tree/linux-6.6.y-rebase-v6.6.87#
Link: https://github.com/Avenger-285714/wyl-linux-dev/tree/linux-6.6.deepin
Co-developed-by: Wentao Guan [email protected]

Summary by Sourcery

Sync the kernel with upstream Linux 6.6.y, introducing hardware support updates, fixes, and enhancements across networking, sound, storage, and platform drivers.

New Features:

  • Add support for a new Realtek RTW8821CU USB Wi-Fi device variant.

Bug Fixes:

  • Correct SoundWire quirks application for specific Intel/Google boards.
  • Fix Loongson LS2x I2C frequency register writes.
  • Prevent UFS RTC updates when the device is not runtime active.

Enhancements:

  • Refine Intel iwlwifi UNII4 channel configuration based on ACPI/DSM values and firmware capabilities.
  • Add a check for UFS runtime power state before device access.
  • Log early Hygon microcode updates.

Build:

  • Update Loongson default configuration. default kernel configuration for Loongson platforms.ong configuration for Loongson3 architecture.

Documentation:

  • Update I2C header comment regarding address space size.

@sourcery-ai
Copy link

sourcery-ai bot commented Apr 26, 2025

Reviewer's Guide by Sourcery

This pull request includes changes rebased from linux-6.6.y. It primarily consists of updates to various drivers, including logic for Intel Wi-Fi UNII4 channels, corrections to Intel SOF SoundWire DMI quirks, power management improvements in the UFS driver, and adding support for a new Realtek Wi-Fi USB device.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Update Intel Wi-Fi driver logic for UNII4 channel evaluation based on ACPI DSM values.
  • Define new enum and macro for UNII4 DSM bitmap values.
  • Apply the defined bitmap mask to the value read from ACPI DSM.
  • Add condition to disable Canada UNII4 bits for older firmware versions or missing capabilities.
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
Correct DMI match entries and associated driver data for Intel SOF SoundWire quirks.
  • Swap DMI match criteria for two entries in the quirk table.
  • Swap the driver data assigned to the two corrected entries.
sound/soc/intel/boards/sof_sdw.c
Improve UFS driver power management by skipping RTC updates when the device is not in an active RPM state.
  • Add a helper function ufshcd_rpm_get_if_active.
  • Use the new helper function in ufshcd_update_rtc to conditionally perform the update.
drivers/ufs/core/ufshcd-priv.h
drivers/ufs/core/ufshcd.c
Add support for a new Realtek RTW8821CU USB device ID.
  • Add USB device ID 0xc82c to the rtw_8821cu_id_table.
drivers/net/wireless/realtek/rtw88/rtw8821cu.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request rebases and aligns deepin’s out‐of‐tree changes with the upstream linux-6.6.y tree, with non‐semantic reordering of driver matching fields and small logic improvements. Key changes include reordering DMI matching and PCI quirk definitions, updating comments in header files, and adding new helper functions to improve device power management and error handling.

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sound/soc/intel/boards/sof_sdw.c Reordered DMI_MATCH parameters in quirk entries for consistency
sound/pci/hda/patch_realtek.c Adjusted ordering of quirks for device matching
include/linux/i2c.h Updated comment on address space (from “7bit” to “6bit”) without corresponding mask change
drivers/ufs/core/ufshcd*.c & ufshcd-priv.h Added RPM state checking before RTC update and new inline helper function
drivers/pci/controller/pci-loongson.c Introduced a new MSI quirk function and removed a duplicate definition
drivers/net/* Added new device IDs and minor refactoring in wireless and Ethernet drivers
drivers/i2c/busses/i2c-ls2x.c Added a new header and modified bus speed setting logic with commentary on byte‐access
arch/x86/kernel/cpu/microcode/amd.c & events/intel/core.c Minor logging improvements and cleanup of redundant punctuation
Files not reviewed (1)
  • arch/loongarch/configs/loongson3_defconfig: Language not supported
Comments suppressed due to low confidence (1)

drivers/i2c/busses/i2c-ls2x.c:115

  • Ensure that the variable 'prer_val' is declared and scoped appropriately since the new comment emphasizes using a byte write; this change should be validated against the hardware register access requirements.
prer_val = LS2X_I2C_PCLK_FREQ / (5 * t->bus_freq_hz) - 1;

struct dentry *debugfs;

/* 7bit address space */
/* 6bit address space */
Copy link

Copilot AI Apr 26, 2025

Choose a reason for hiding this comment

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

The comment now states '6bit address space' yet the bitmap is declared with '1 << 7' which corresponds to a 7-bit address space; please verify that the comment and code are consistent.

Suggested change
/* 6bit address space */
/* 7bit address space */

Copilot uses AI. Check for mistakes.
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Avenger-285714 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The description notes that PR489 is being ignored; please confirm this is the intended state for this synchronization effort.
  • Several code blocks appear to have been moved without functional changes (e.g., in pci-loongson.c, patch_realtek.c); please verify these movements are intentional and not artifacts of the rebase.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.


struct dentry *debugfs;

/* 7bit address space */
Copy link

Choose a reason for hiding this comment

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

question (bug_risk): Validate the comment update regarding I2C address space.

I2C addresses are typically described as 7-bit entities (with the 8th bit used for R/W). Please ensure that the updated comment accurately reflects the design or hardware requirements for this adapter, or else it might cause confusion for future maintainers.

@opsiff
Copy link
Member

opsiff commented Apr 26, 2025

build failed, there are something duplicate from rebase.

struct dentry *debugfs;

/* 7bit address space */
/* 6bit address space */
Copy link
Member

Choose a reason for hiding this comment

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

DMA_STATUS_TPS | DMA_STATUS_TI | \
DMA_STATUS_MSK_COMMON_LOONGSON)

#define DRIVER_NAME "dwmac-loongson-pci"
Copy link
Member

Choose a reason for hiding this comment

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

82行重复了

.driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },
{ USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xc82b, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },
{ USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xc82c, 0xff, 0xff, 0xff),
Copy link
Member

Choose a reason for hiding this comment

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

val = ts64.tv_sec - hba->dev_info.rtc_time_baseline;

ufshcd_rpm_get_sync(hba);
/* Skip update RTC if RPM state is not RPM_ACTIVE */
Copy link
Member

Choose a reason for hiding this comment

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

return gen_def->mac_pre_init(rtwdev);
}

static inline int rtw89_pci_ops_mac_pre_deinit(struct rtw89_dev *rtwdev)
Copy link
Member

Choose a reason for hiding this comment

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

It used?

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. arch/loongarch/configs/loongson3_defconfig文件中,新增了CONFIG_ZSMALLOC=m配置项,但没有提供相应的配置说明或注释,建议添加以帮助理解该配置项的用途。

  2. arch/x86/events/intel/core.c文件中,default_is_visible函数被移动到了文件末尾,这可能会影响代码的可读性。建议将函数放置在更合适的位置,例如在相关函数的上方或根据函数的调用顺序进行排序。

  3. drivers/i2c/busses/i2c-ls2x.c文件中,ls2x_i2c_adjust_bus_speed函数中使用了writeb函数来设置I2C频率,但注释中提到只能按字节访问寄存器,这可能会导致高位被截断。建议使用writew函数来确保高位不被截断。

  4. drivers/net/ethernet/cadence/macb.h文件中,struct macb结构体中的ndev成员被移动到了结构体的末尾,这可能会影响代码的可读性。建议根据成员的用途或调用顺序进行排序。

  5. drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c文件中,宏DRIVER_NAME的定义被移动到了文件末尾,这可能会影响代码的可读性。建议将宏定义放置在文件的开头或根据代码的调用顺序进行排序。

  6. drivers/net/wireless/intel/iwlwifi/mvm/fw.c文件中,iwl_mvm_lari_cfg函数中新增了对cmd_ver的检查,以确保版本兼容性。建议添加相应的注释来解释这一变更的原因和影响。

  7. drivers/net/wireless/realtek/rtw88/rtw8821cu.c文件中,新增了对USB设备ID 0xc82c的支持,但未提供相应的配置说明或注释,建议添加以帮助理解该变更的用途。

  8. drivers/net/wireless/realtek/rtw89/pci.c文件中,rtw89_pci_ops_mac_pre_deinit函数被添加,但未提供相应的注释或文档说明其用途和功能。

  9. drivers/pci/controller/pci-loongson.c文件中,loongson_pci_msi_quirk函数被移动到了文件末尾,这可能会影响代码的可读性。建议将函数放置在更合适的位置,例如在相关函数的上方或根据函数的调用顺序进行排序。

  10. drivers/ufs/core/ufshcd-priv.h文件中,新增了ufshcd_rpm_get_if_active函数,但未提供相应的注释或文档说明其用途和功能。

  11. drivers/ufs/core/ufshcd.c文件中,ufshcd_update_rtc函数中新增了对RPM状态的检查,以确保在RPM非活动状态下不更新RTC。建议添加相应的注释来解释这一变更的原因和影响。

  12. sound/pci/hda/patch_realtek.c文件中,alc269_fixup_tbl数组中的DMI匹配项被修改,但未提供相应的注释或文档说明这些变更的用途和影响。

  13. sound/soc/intel/boards/sof_sdw.c文件中,sof_sdw_quirk_table数组中的DMI匹配项被修改,但未提供相应的注释或文档说明这些变更的用途和影响。

总体来说,代码的修改和调整需要更多的注释和文档说明,以便其他开发者更好地理解代码的变更和用途。同时,建议在代码中添加更多的错误处理和边界检查,以提高代码的健壮性和可靠性。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants