Netdev List
 help / color / mirror / Atom feed
* [PATCH net] r8152: handle the return value of usb_reset_device()
@ 2026-06-04  9:22 Chih Kai Hsu
  2026-06-04  9:28 ` Hayes Wang
  2026-06-04 12:53 ` Andrew Lunn
  0 siblings, 2 replies; 5+ messages in thread
From: Chih Kai Hsu @ 2026-06-04  9:22 UTC (permalink / raw)
  To: kuba, davem; +Cc: netdev, nic_swsd, linux-kernel, linux-usb, Chih Kai Hsu

If usb_reset_device() returns a negative error code, stop the
process of probing.

Fixes: 10c3271712f5 ("r8152: disable the ECM mode")
Signed-off-by: Chih Kai Hsu <hsu.chih.kai@realtek.com>
---
 drivers/net/usb/r8152.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 1ace1d2398c9..b1268553cd70 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -9851,7 +9851,12 @@ static int rtl8152_probe_once(struct usb_interface *intf,
 	struct net_device *netdev;
 	int ret;
 
-	usb_reset_device(udev);
+	ret = usb_reset_device(udev);
+	if (ret < 0) {
+		dev_err(&intf->dev, "USB reset failed, errno=%d\n", ret);
+		return ret;
+	}
+
 	netdev = alloc_etherdev(sizeof(struct r8152));
 	if (!netdev) {
 		dev_err(&intf->dev, "Out of memory\n");
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH net] r8152: handle the return value of usb_reset_device()
  2026-06-04  9:22 [PATCH net] r8152: handle the return value of usb_reset_device() Chih Kai Hsu
@ 2026-06-04  9:28 ` Hayes Wang
  2026-06-04 12:53 ` Andrew Lunn
  1 sibling, 0 replies; 5+ messages in thread
From: Hayes Wang @ 2026-06-04  9:28 UTC (permalink / raw)
  To: Chih Kai Hsu, kuba@kernel.org, davem@davemloft.net
  Cc: netdev@vger.kernel.org, nic_swsd, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, Chih Kai Hsu

Chih Kai Hsu <hsu.chih.kai@realtek.com>
> Sent: Thursday, June 4, 2026 5:23 PM
> To: kuba@kernel.org; davem@davemloft.net
> Cc: netdev@vger.kernel.org; nic_swsd <nic_swsd@realtek.com>;
> linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org; Chih Kai Hsu
> <hsu.chih.kai@realtek.com>
> Subject: [PATCH net] r8152: handle the return value of usb_reset_device()
> 
> If usb_reset_device() returns a negative error code, stop the process of
> probing.
> 
> Fixes: 10c3271712f5 ("r8152: disable the ECM mode")
> Signed-off-by: Chih Kai Hsu <hsu.chih.kai@realtek.com>

Reviewed-by: Hayes Wang <hayeswang@realtek.com>

Best Regards,
Hayes


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] r8152: handle the return value of usb_reset_device()
  2026-06-04  9:22 [PATCH net] r8152: handle the return value of usb_reset_device() Chih Kai Hsu
  2026-06-04  9:28 ` Hayes Wang
@ 2026-06-04 12:53 ` Andrew Lunn
  2026-06-05  2:42   ` Chih Kai Hsu
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2026-06-04 12:53 UTC (permalink / raw)
  To: Chih Kai Hsu; +Cc: kuba, davem, netdev, nic_swsd, linux-kernel, linux-usb

On Thu, Jun 04, 2026 at 05:22:47PM +0800, Chih Kai Hsu wrote:
> If usb_reset_device() returns a negative error code, stop the
> process of probing.
> 
> Fixes: 10c3271712f5 ("r8152: disable the ECM mode")

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

Does this bother people?

	Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH net] r8152: handle the return value of usb_reset_device()
  2026-06-04 12:53 ` Andrew Lunn
@ 2026-06-05  2:42   ` Chih Kai Hsu
  2026-06-05  4:03     ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Chih Kai Hsu @ 2026-06-05  2:42 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
	nic_swsd, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org

On 04/06/26 8:54 pm, Andrew Lunn wrote:

> On Thu, Jun 04, 2026 at 05:22:47PM +0800, Chih Kai Hsu wrote:
> > If usb_reset_device() returns a negative error code, stop the process
> > of probing.
> >
> > Fixes: 10c3271712f5 ("r8152: disable the ECM mode")
> 
> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> 
> Does this bother people?
Yes, it does.
If the driver does not return early when receiving an error code from usb_reset_device(),
the subsequent execution will trigger a kernel call trace.

> 
>         Andrew

Best Regards,
Chih Kai

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] r8152: handle the return value of usb_reset_device()
  2026-06-05  2:42   ` Chih Kai Hsu
@ 2026-06-05  4:03     ` Andrew Lunn
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2026-06-05  4:03 UTC (permalink / raw)
  To: Chih Kai Hsu
  Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
	nic_swsd, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org

On Fri, Jun 05, 2026 at 02:42:34AM +0000, Chih Kai Hsu wrote:
> On 04/06/26 8:54 pm, Andrew Lunn wrote:
> 
> > On Thu, Jun 04, 2026 at 05:22:47PM +0800, Chih Kai Hsu wrote:
> > > If usb_reset_device() returns a negative error code, stop the process
> > > of probing.
> > >
> > > Fixes: 10c3271712f5 ("r8152: disable the ECM mode")
> > 
> > https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> > 
> > Does this bother people?
> Yes, it does.
> If the driver does not return early when receiving an error code from usb_reset_device(),
> the subsequent execution will trigger a kernel call trace.

Please include a link to such a bug report, kernel call trace etc, to
to show it bothers somebody. Do you have the hardware and can trigger
this?

	Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-05  4:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-04  9:22 [PATCH net] r8152: handle the return value of usb_reset_device() Chih Kai Hsu
2026-06-04  9:28 ` Hayes Wang
2026-06-04 12:53 ` Andrew Lunn
2026-06-05  2:42   ` Chih Kai Hsu
2026-06-05  4:03     ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox