public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Chih Kai Hsu <hsu.chih.kai@realtek.com>
To: <kuba@kernel.org>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <nic_swsd@realtek.com>,
	<linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>,
	<edumazet@google.com>, <bjorn@mork.no>, <pabeni@redhat.com>,
	Chih Kai Hsu <hsu.chih.kai@realtek.com>
Subject: [PATCH net-next v4 1/3] r8152: fix incorrect register write to USB_UPHY_XTAL
Date: Thu, 26 Mar 2026 15:39:23 +0800	[thread overview]
Message-ID: <20260326073925.32976-454-nic_swsd@realtek.com> (raw)
In-Reply-To: <20260326073925.32976-453-nic_swsd@realtek.com>

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: 195aae321c82 ("r8152: support new chips")
Signed-off-by: Chih Kai Hsu <hsu.chih.kai@realtek.com>
---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 3b6d4252d34c..bef0611e7ef0 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3892,7 +3892,7 @@ static void r8156_ups_en(struct r8152 *tp, bool enable)
 		case RTL_VER_15:
 			ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_UPHY_XTAL);
 			ocp_data &= ~OOBS_POLLING;
-			ocp_write_byte(tp, MCU_TYPE_USB, USB_UPHY_XTAL, ocp_data);
+			ocp_write_word(tp, MCU_TYPE_USB, USB_UPHY_XTAL, ocp_data);
 			break;
 		default:
 			break;
-- 
2.34.1


  reply	other threads:[~2026-03-26  7:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26  7:39 [PATCH net-next v4 0/3] r8152: add helper functions for PLA/USB/PHY OCP registers Chih Kai Hsu
2026-03-26  7:39 ` Chih Kai Hsu [this message]
2026-03-26 13:18   ` [PATCH net-next v4 1/3] r8152: fix incorrect register write to USB_UPHY_XTAL Hayes Wang
2026-03-26  7:39 ` [PATCH net-next v4 2/3] r8152: add helper functions for PLA/USB OCP registers Chih Kai Hsu
2026-03-26 13:19   ` Hayes Wang
2026-03-26  7:39 ` [PATCH net-next v4 3/3] r8152: add helper functions for PHY " Chih Kai Hsu
2026-03-26 13:19   ` Hayes Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260326073925.32976-454-nic_swsd@realtek.com \
    --to=hsu.chih.kai@realtek.com \
    --cc=bjorn@mork.no \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox