[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] r8152: fix incorrect register write to USB_UPHY_XTAL#1747
Conversation
[Upstream commit 48afd5124fd6129c46fd12cb06155384b1c4a0c4] The old code used ocp_write_byte() to clear the OOBS_POLLING bit (BIT(8)) in the USB_UPHY_XTAL register, but this doesn't correctly clear a bit in the upper byte of the 16-bit register. Fix this by using ocp_write_word() instead. Fixes: 195aae3 ("r8152: support new chips") Signed-off-by: Chih Kai Hsu <hsu.chih.kai@realtek.com> Reviewed-by: Hayes Wang <hayeswang@realtek.com> Link: https://patch.msgid.link/20260326073925.32976-454-nic_swsd@realtek.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the r8152 USB network driver to correctly clear a 16-bit register bit by switching from a byte write helper to a word write helper when modifying USB_UPHY_XTAL for certain chip revisions. Sequence diagram for updated r8156_ups_en register writesequenceDiagram
participant Driver as r8156_ups_en
participant USBMCU as MCU_TYPE_USB
Driver->>USBMCU: ocp_read_word(USB_UPHY_XTAL)
USBMCU-->>Driver: ocp_data
Driver->>Driver: ocp_data &= ~OOBS_POLLING
Driver->>USBMCU: ocp_write_word(USB_UPHY_XTAL, ocp_data)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Pull request overview
Fixes a Realtek r8152/r8156 USB OCP register programming bug where clearing OOBS_POLLING (BIT(8)) in the 16-bit USB_UPHY_XTAL register incorrectly used an 8-bit write, preventing the upper-byte bit from being cleared.
Changes:
- Replace
ocp_write_byte()withocp_write_word()when updatingUSB_UPHY_XTALinr8156_ups_en(). - Ensure the
OOBS_POLLINGbit (BIT(8)) is actually cleared in the 16-bit register value read viaocp_read_word().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: opsiff The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[Upstream commit 48afd5124fd6129c46fd12cb06155384b1c4a0c4]
The old code used ocp_write_byte() to clear the OOBS_POLLING bit (BIT(8)) in the USB_UPHY_XTAL register, but this doesn't correctly clear a bit in the upper byte of the 16-bit register.
Fix this by using ocp_write_word() instead.
Fixes: 195aae3 ("r8152: support new chips")
Reviewed-by: Hayes Wang hayeswang@realtek.com
Link: https://patch.msgid.link/20260326073925.32976-454-nic_swsd@realtek.com
Summary by Sourcery
Bug Fixes: