[Deepin-Kernel-SIG] [linux 6.18.y] [Upstream] r8152: fix incorrect register write to USB_UPHY_XTAL#1746
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 GuideThis PR fixes how the driver clears the OOBS_POLLING bit in the USB_UPHY_XTAL register for r8156 devices by switching from a byte write to a word write, ensuring the upper byte of the 16‑bit register is updated correctly. Sequence diagram for updated r8156_ups_en register writesequenceDiagram
participant r8156_ups_en
participant ocp_read_word
participant ocp_write_word
participant USB_UPHY_XTAL
r8156_ups_en->>ocp_read_word: ocp_read_word(tp, MCU_TYPE_USB, USB_UPHY_XTAL)
ocp_read_word-->>r8156_ups_en: ocp_data
r8156_ups_en->>r8156_ups_en: ocp_data &= ~OOBS_POLLING
r8156_ups_en->>ocp_write_word: ocp_write_word(tp, MCU_TYPE_USB, USB_UPHY_XTAL, ocp_data)
ocp_write_word-->>USB_UPHY_XTAL: update 16_bit_register
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 an r8152 driver bug where clearing OOBS_POLLING (BIT(8)) in the 16-bit USB_UPHY_XTAL register was incorrectly performed with an 8-bit write, which cannot clear a bit in the upper byte.
Changes:
- Replace
ocp_write_byte()withocp_write_word()when updatingUSB_UPHY_XTALfor RTL_VER_13/RTL_VER_15. - Ensures
OOBS_POLLING(BIT(8)) is correctly cleared in the full 16-bit register value.
💡 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: