2019-03-05 18:34:41

by Xose Vazquez Perez

[permalink] [raw]
Subject: mediatek: duplicate usb devices

Hi,


There a three duplicate devices at:

mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Alfa AWUS036ACM */
mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Aukey USB-AC1200 */

mt76/mt76x0/usb.c: { USB_DEVICE(0x148f, 0x760a) }, /* TP-Link unknown */
mt7601u/usb.c: { USB_DEVICE(0x148f, 0x760a) },

mt76/mt76x0/usb.c: { USB_DEVICE(0x7392, 0xb711) }, /* Edimax / Elecom */
mt76/mt76x2/usb.c: { USB_DEVICE(0x7392, 0xb711) }, /* Edimax EW 7722 UAC */


Thanks.


2019-03-06 05:14:13

by Kalle Valo

[permalink] [raw]
Subject: Re: mediatek: duplicate usb devices

+ jakub

Xose Vazquez Perez <[email protected]> writes:

> There a three duplicate devices at:

[...]

> mt76/mt76x0/usb.c: { USB_DEVICE(0x148f, 0x760a) }, /* TP-Link unknown */
> mt7601u/usb.c: { USB_DEVICE(0x148f, 0x760a) },

This is not good, two drivers should not be competing about the same
device. So which driver should support this device?

--
Kalle Valo

2019-03-06 07:50:59

by Stanislaw Gruszka

[permalink] [raw]
Subject: Re: mediatek: duplicate usb devices

On Tue, Mar 05, 2019 at 07:33:51PM +0100, Xose Vazquez Perez wrote:
> There a three duplicate devices at:
>
> mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Alfa AWUS036ACM */
> mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Aukey USB-AC1200 */
One duplicated entry should be removed.

> mt76/mt76x0/usb.c: { USB_DEVICE(0x148f, 0x760a) }, /* TP-Link unknown */
> mt7601u/usb.c: { USB_DEVICE(0x148f, 0x760a) },
Not sure about this.

> mt76/mt76x0/usb.c: { USB_DEVICE(0x7392, 0xb711) }, /* Edimax / Elecom */
> mt76/mt76x2/usb.c: { USB_DEVICE(0x7392, 0xb711) }, /* Edimax EW 7722 UAC */
According to wikidevi we really have duplicated IDs:

https://wikidevi.com/wiki/Edimax_EW-7722UAC
https://wikidevi.com/wiki/Elecom_WDC-433SU2M

I think we can handle this by checking ASIC version from the EEPROM
or registers at the beginning of probe and exit if it does not mach.
This should assure we will load proper driver.

Stanislaw

2019-03-06 09:16:50

by Lorenzo Bianconi

[permalink] [raw]
Subject: Re: mediatek: duplicate usb devices

>
> On Tue, Mar 05, 2019 at 07:33:51PM +0100, Xose Vazquez Perez wrote:
> > There a three duplicate devices at:
> >
> > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Alfa AWUS036ACM */
> > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Aukey USB-AC1200 */

This has been introduced in commit 62a25dc56990a, I will post a fix

Regards,
Lorenzo

> One duplicated entry should be removed.
>
> > mt76/mt76x0/usb.c: { USB_DEVICE(0x148f, 0x760a) }, /* TP-Link unknown */
> > mt7601u/usb.c: { USB_DEVICE(0x148f, 0x760a) },
> Not sure about this.
>
> > mt76/mt76x0/usb.c: { USB_DEVICE(0x7392, 0xb711) }, /* Edimax / Elecom */
> > mt76/mt76x2/usb.c: { USB_DEVICE(0x7392, 0xb711) }, /* Edimax EW 7722 UAC */
> According to wikidevi we really have duplicated IDs:
>
> https://wikidevi.com/wiki/Edimax_EW-7722UAC
> https://wikidevi.com/wiki/Elecom_WDC-433SU2M
>
> I think we can handle this by checking ASIC version from the EEPROM
> or registers at the beginning of probe and exit if it does not mach.
> This should assure we will load proper driver.
>
> Stanislaw

--
UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch;
unzip; touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp;
umount; make clean; sleep

2019-03-06 10:09:49

by Lorenzo Bianconi

[permalink] [raw]
Subject: Re: mediatek: duplicate usb devices

>
> On Tue, Mar 05, 2019 at 07:33:51PM +0100, Xose Vazquez Perez wrote:
> > There a three duplicate devices at:
> >
> > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Alfa AWUS036ACM */
> > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Aukey USB-AC1200 */
> One duplicated entry should be removed.
>
> > mt76/mt76x0/usb.c: { USB_DEVICE(0x148f, 0x760a) }, /* TP-Link unknown */
> > mt7601u/usb.c: { USB_DEVICE(0x148f, 0x760a) },

IIUC this is not in the mt7601u driver available on mtk website.
@Jakub: should we remove it from mt7601u driver?

> Not sure about this.
>
> > mt76/mt76x0/usb.c: { USB_DEVICE(0x7392, 0xb711) }, /* Edimax / Elecom */
> > mt76/mt76x2/usb.c: { USB_DEVICE(0x7392, 0xb711) }, /* Edimax EW 7722 UAC */
> According to wikidevi we really have duplicated IDs:
>
> https://wikidevi.com/wiki/Edimax_EW-7722UAC
> https://wikidevi.com/wiki/Elecom_WDC-433SU2M
>
> I think we can handle this by checking ASIC version from the EEPROM
> or registers at the beginning of probe and exit if it does not mach.
> This should assure we will load proper driver.
>
> Stanislaw



--
UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch;
unzip; touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp;
umount; make clean; sleep

2019-03-06 11:03:34

by Stanislaw Gruszka

[permalink] [raw]
Subject: Re: mediatek: duplicate usb devices

On Wed, Mar 06, 2019 at 11:09:12AM +0100, Lorenzo Bianconi wrote:
> >
> > On Tue, Mar 05, 2019 at 07:33:51PM +0100, Xose Vazquez Perez wrote:
> > > There a three duplicate devices at:
> > >
> > > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Alfa AWUS036ACM */
> > > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Aukey USB-AC1200 */
> > One duplicated entry should be removed.
> >
> > > mt76/mt76x0/usb.c: { USB_DEVICE(0x148f, 0x760a) }, /* TP-Link unknown */
> > > mt7601u/usb.c: { USB_DEVICE(0x148f, 0x760a) },
>
> IIUC this is not in the mt7601u driver available on mtk website.

The same apply to mt7610u. Vendor driver have only IDs for some
reference devices. Both mt7601u and mt7610u drivers do not include
0x7610.

For mt76x0u ids were provided by Hans
https://lore.kernel.org/linux-wireless/alpine.LNX.2.00.1804092042320.8369@T420s/
I'm not sure where they came from.

Stanislaw


2019-03-06 18:49:35

by Jakub Kicinski

[permalink] [raw]
Subject: Re: mediatek: duplicate usb devices

On Wed, 6 Mar 2019 12:03:30 +0100, Stanislaw Gruszka wrote:
> On Wed, Mar 06, 2019 at 11:09:12AM +0100, Lorenzo Bianconi wrote:
> > >
> > > On Tue, Mar 05, 2019 at 07:33:51PM +0100, Xose Vazquez Perez wrote:
> > > > There a three duplicate devices at:
> > > >
> > > > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Alfa AWUS036ACM */
> > > > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Aukey USB-AC1200 */
> > > One duplicated entry should be removed.
> > >
> > > > mt76/mt76x0/usb.c: { USB_DEVICE(0x148f, 0x760a) }, /* TP-Link unknown */
> > > > mt7601u/usb.c: { USB_DEVICE(0x148f, 0x760a) },
> >
> > IIUC this is not in the mt7601u driver available on mtk website.
>
> The same apply to mt7610u. Vendor driver have only IDs for some
> reference devices. Both mt7601u and mt7610u drivers do not include
> 0x7610.
>
> For mt76x0u ids were provided by Hans
> https://lore.kernel.org/linux-wireless/alpine.LNX.2.00.1804092042320.8369@T420s/
> I'm not sure where they came from.

The ones in mt7601u came from Xose, the GitHub repo has fuller history:

https://github.com/kuba-moo/mt7601u/commit/5e6b565301d9882aab9af46b396a5cf489db6c78

I don't really mind which one stays :)

2019-03-07 10:21:31

by Stanislaw Gruszka

[permalink] [raw]
Subject: Re: mediatek: duplicate usb devices

On Wed, Mar 06, 2019 at 10:42:40AM -0800, Jakub Kicinski wrote:
> On Wed, 6 Mar 2019 12:03:30 +0100, Stanislaw Gruszka wrote:
> > On Wed, Mar 06, 2019 at 11:09:12AM +0100, Lorenzo Bianconi wrote:
> > > >
> > > > On Tue, Mar 05, 2019 at 07:33:51PM +0100, Xose Vazquez Perez wrote:
> > > > > There a three duplicate devices at:
> > > > >
> > > > > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Alfa AWUS036ACM */
> > > > > mt76/mt76x2/usb.c: { USB_DEVICE(0x0e8d, 0x7612) }, /* Aukey USB-AC1200 */
> > > > One duplicated entry should be removed.
> > > >
> > > > > mt76/mt76x0/usb.c: { USB_DEVICE(0x148f, 0x760a) }, /* TP-Link unknown */
> > > > > mt7601u/usb.c: { USB_DEVICE(0x148f, 0x760a) },
> > >
> > > IIUC this is not in the mt7601u driver available on mtk website.
> >
> > The same apply to mt7610u. Vendor driver have only IDs for some
> > reference devices. Both mt7601u and mt7610u drivers do not include
> > 0x7610.
> >
> > For mt76x0u ids were provided by Hans
> > https://lore.kernel.org/linux-wireless/alpine.LNX.2.00.1804092042320.8369@T420s/
> > I'm not sure where they came from.
>
> The ones in mt7601u came from Xose, the GitHub repo has fuller history:
>
> https://github.com/kuba-moo/mt7601u/commit/5e6b565301d9882aab9af46b396a5cf489db6c78
>
> I don't really mind which one stays :)

I think this is same case as with duplicated id's for mt76x0u and
mt76x2u. We should not remove the IDs. I will just post patches that
will check chip version.

Stanislaw