public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] r8152:  add Linksys USB3GIGV1 id
@ 2017-09-22 19:06 Grant Grundler
  2017-09-25 14:51 ` Oliver Neukum
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Grundler @ 2017-09-22 19:06 UTC (permalink / raw)
  To: Hayes Wang; +Cc: linux-usb, David S . Miller, LKML, netdev, Grant Grundler

This Linksys dongle by default comes up in cdc_ether mode.
This patch allows r8152 to claim the device:
   Bus 002 Device 002: ID 13b1:0041 Linksys

Signed-off-by: Grant Grundler <grundler@chromium.org>
---
 drivers/net/usb/r8152.c | 2 ++
 1 file changed, 2 insertions(+)

This was tested on chromeos-3.14, chromeos-3.18, and chromeos-4.4 kernels
with a mix of ARM/x86-64 systems.

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index ceb78e2ea4f0..941ece08ba78 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -613,6 +613,7 @@ enum rtl8152_flags {
 #define VENDOR_ID_MICROSOFT		0x045e
 #define VENDOR_ID_SAMSUNG		0x04e8
 #define VENDOR_ID_LENOVO		0x17ef
+#define VENDOR_ID_LINKSYS		0x13b1
 #define VENDOR_ID_NVIDIA		0x0955
 
 #define MCU_TYPE_PLA			0x0100
@@ -5316,6 +5317,7 @@ static const struct usb_device_id rtl8152_table[] = {
 	{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x7205)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x720c)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO,  0x7214)},
+	{REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041)},
 	{REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA,  0x09ff)},
 	{}
 };
-- 
2.14.1.821.g8fa685d3b7-goog

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

* Re: [PATCH] r8152:  add Linksys USB3GIGV1 id
  2017-09-22 19:06 [PATCH] r8152: add Linksys USB3GIGV1 id Grant Grundler
@ 2017-09-25 14:51 ` Oliver Neukum
  2017-09-25 20:17   ` Grant Grundler
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Neukum @ 2017-09-25 14:51 UTC (permalink / raw)
  To: Grant Grundler, Hayes Wang; +Cc: David S . Miller, LKML, linux-usb, netdev

Am Freitag, den 22.09.2017, 12:06 -0700 schrieb Grant Grundler:
> This Linksys dongle by default comes up in cdc_ether mode.
> This patch allows r8152 to claim the device:
>    Bus 002 Device 002: ID 13b1:0041 Linksys

Hi,

have you tested this in case cdc_ether is for some reason already
loaded? The patch seems to enable r8152 but does not disable
cdc_ether.

	Regards
		Oliver

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

* Re: [PATCH] r8152: add Linksys USB3GIGV1 id
  2017-09-25 14:51 ` Oliver Neukum
@ 2017-09-25 20:17   ` Grant Grundler
  2017-09-26  1:12     ` Grant Grundler
  2017-09-26  7:35     ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Grant Grundler @ 2017-09-25 20:17 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Grant Grundler, Hayes Wang, David S . Miller, LKML, linux-usb,
	netdev

[grrhmail...sorry! resending as plain text]

Hallo Oliver!

On Mon, Sep 25, 2017 at 7:51 AM, Oliver Neukum <oneukum@suse.com> wrote:
> Am Freitag, den 22.09.2017, 12:06 -0700 schrieb Grant Grundler:
> > This Linksys dongle by default comes up in cdc_ether mode.
> > This patch allows r8152 to claim the device:
> >    Bus 002 Device 002: ID 13b1:0041 Linksys
>
> Hi,
>
> have you tested this in case cdc_ether is for some reason already
> loaded?

I did not consider testing this case since it's not possible on a
normal chromeos system (the entire root file system is signed for
normal users and get's rebooted after an update).  I could test this
in developer mode of course.

Did you expect both driver probe routines to claim the device and
wreak havoc with the device?

> The patch seems to enable r8152 but does not disable cdc_ether.

Correct. r8152 happens to claim the device before cdc_ether does - I
thought because cdc_ether is a class driver and only gets picked up
after vendor specific drivers are probed.  Is that correct?

I didn't realize cdc_ether has a blacklist to make sure
RTL8152|RTL8153 devices are not picked up by cdc_ether. Would you
prefer I add this device to the blacklist in the same patch?

cheers,
grant

>
>         Regards
>                 Oliver
>

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

* Re: [PATCH] r8152: add Linksys USB3GIGV1 id
  2017-09-25 20:17   ` Grant Grundler
@ 2017-09-26  1:12     ` Grant Grundler
  2017-09-26  7:35     ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Grant Grundler @ 2017-09-26  1:12 UTC (permalink / raw)
  To: Grant Grundler
  Cc: Oliver Neukum, Hayes Wang, David S . Miller, LKML, linux-usb,
	netdev

On Mon, Sep 25, 2017 at 1:17 PM, Grant Grundler <grundler@chromium.org> wrote:
...
> I didn't realize cdc_ether has a blacklist to make sure
> RTL8152|RTL8153 devices are not picked up by cdc_ether. Would you
> prefer I add this device to the blacklist in the same patch?

I've sent a V2 which also updates the blacklist in cdc_ether.

cheers,
grant

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

* Re: [PATCH] r8152: add Linksys USB3GIGV1 id
  2017-09-25 20:17   ` Grant Grundler
  2017-09-26  1:12     ` Grant Grundler
@ 2017-09-26  7:35     ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2017-09-26  7:35 UTC (permalink / raw)
  To: Grant Grundler
  Cc: Oliver Neukum, Hayes Wang, David S . Miller, LKML, linux-usb,
	netdev

On Mon, Sep 25, 2017 at 01:17:32PM -0700, Grant Grundler wrote:
> Correct. r8152 happens to claim the device before cdc_ether does - I
> thought because cdc_ether is a class driver and only gets picked up
> after vendor specific drivers are probed.  Is that correct?

Nope, there is not "priority" scheme of binding some drivers to devices
instead of others at all in Linux.  The whole scheme is "first in the
list", and has always been that way.

And yes, people have talked about changing this for decades now, but no
one has come up with any working patch, for the obvious reasons[1].

thanks,

greg k-h

[1] exercise is left for the reader :)

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

end of thread, other threads:[~2017-09-26  7:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-22 19:06 [PATCH] r8152: add Linksys USB3GIGV1 id Grant Grundler
2017-09-25 14:51 ` Oliver Neukum
2017-09-25 20:17   ` Grant Grundler
2017-09-26  1:12     ` Grant Grundler
2017-09-26  7:35     ` Greg KH

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