2021-06-08 19:06:18

by Alan Stern

[permalink] [raw]
Subject: Re: Strange problem with USB device

On Tue, Jun 08, 2021 at 01:37:07PM -0500, Larry Finger wrote:
> On 6/8/21 1:20 PM, Alan Stern wrote:
> > One thing you might try is to turn on USB debugging before
> > plugging in the device:
> >
> > echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control
> >
> > The additional information this adds to the dmesg log may be
> > helpful.
>
> The BT device is part of the same card as the PCIe wifi device, thus
> there is no "plugging" it in a conventional sense.

I don't get it. If this is a PCIe device, why should it appear
on a USB bus? Wouldn't you expect it to show up as a PCI device
on a PCI bus instead?

> Is there some way to
> add the usbcore debugging statement to the kernel options line at boot
> time?

Yes. Use the kernel boot-line parameter:

usbcore.dyndbg="=p"

FYI, how to use dynamic debugging is explained at length in the
kernel source file
Documentation/admin-guide/dynamic-debug-howto.rst.

Alan Stern

> As I told GregKH, I am having the person with the problem try a rescue
> system with a 5.12 kernel.
>
> Larry
>


2021-06-08 20:59:56

by Larry Finger

[permalink] [raw]
Subject: Re: Strange problem with USB device

On 6/8/21 1:53 PM, Alan Stern wrote:
> I don't get it. If this is a PCIe device, why should it appear
> on a USB bus? Wouldn't you expect it to show up as a PCI device
> on a PCI bus instead?
>

I do not know the internal details, but Realtek packages a PCIe wifi device and
a bluetooth USB device in the same package. Intel does the same thing on my
Wireless 7260.

My lsusb shows:
Bus 003 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 8087:07dc Intel Corp. Bluetooth wireless interface
Bus 002 Device 003: ID 0bda:c822 Realtek Semiconductor Corp. Bluetooth Radio
Bus 002 Device 002: ID 04f2:b3b2 Chicony Electronics Co., Ltd TOSHIBA Web Camera
- FHD
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I have no devices plugged into a USB port.

Larry

2021-06-09 16:56:15

by Larry Finger

[permalink] [raw]
Subject: Re: Strange problem with USB device

On 6/8/21 1:53 PM, Alan Stern wrote:
> Yes. Use the kernel boot-line parameter:
>
> usbcore.dyndbg="=p"
>

This command was tried, but no additional output occurred in dmesg.

The user has now tried a number of Linux distros, none of which worked, thus it
seems to be a kernel problem. I have written to the BT people at Realtek to see
if they have an suggestions. I will let you know when I learn more.

Larry

2021-06-09 17:03:45

by Alan Stern

[permalink] [raw]
Subject: Re: Strange problem with USB device

On Tue, Jun 08, 2021 at 03:56:11PM -0500, Larry Finger wrote:
> On 6/8/21 1:53 PM, Alan Stern wrote:
> > I don't get it. If this is a PCIe device, why should it appear
> > on a USB bus? Wouldn't you expect it to show up as a PCI device
> > on a PCI bus instead?
> >
>
> I do not know the internal details, but Realtek packages a PCIe wifi
> device and a bluetooth USB device in the same package. Intel does the
> same thing on my Wireless 7260.
>
> My lsusb shows:
> Bus 003 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
> Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 001 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> Bus 002 Device 004: ID 8087:07dc Intel Corp. Bluetooth wireless interface
> Bus 002 Device 003: ID 0bda:c822 Realtek Semiconductor Corp. Bluetooth Radio
> Bus 002 Device 002: ID 04f2:b3b2 Chicony Electronics Co., Ltd TOSHIBA
> Web Camera - FHD
> Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
>
> I have no devices plugged into a USB port.

Okay, now I get the picture. The Intel PCIe card contains an
EHCI USB host controller plus a couple of on-board USB Bluetooth
devices and an on-board USB webcam, in addition to the PCIe wifi
device.

Which means you're looking at the problem all wrong. It isn't a
USB problem at all; it's a PCI problem. Namely, why doesn't the
system detect the USB host controller on the PCIe board?

I have added the PCI maintainer and mailing list to the CC.
Maybe they can help shed some light.

The original Suse Bugzilla report:

https://bugzilla.suse.com/show_bug.cgi?id=1186889

shows the Realtek board at PCI address 0000:03:00.0, but there's
no mention of a USB host controller on that board. The only host
controller on the system is the one at address 0000:00:14.0,
which is xHCI and is directly on the motherboard.

Furthermore, there's no trace of any mention of an EHCI USB host
controller in the system log. So maybe the board has to be told
somehow to turn that controller on before it will show up, and
the rtw_8822ce driver isn't giving the appropriate order.

Can the bug reporter get information from Windows about the USB
host controllers, and in particular, the one on the RTL8822
board?

Alan Stern

2021-06-11 00:10:46

by Ibrahim Erturk

[permalink] [raw]
Subject: Re: Strange problem with USB device

Hi,

I've already attached logs and a snapshot from the device manager on
the windows side into the bug report. Hope this helps.

Regards,
Ibrahim ERTURK

On Wed, Jun 9, 2021 at 5:12 AM Alan Stern <[email protected]> wrote:
>
> On Tue, Jun 08, 2021 at 03:56:11PM -0500, Larry Finger wrote:
> > On 6/8/21 1:53 PM, Alan Stern wrote:
> > > I don't get it. If this is a PCIe device, why should it appear
> > > on a USB bus? Wouldn't you expect it to show up as a PCI device
> > > on a PCI bus instead?
> > >
> >
> > I do not know the internal details, but Realtek packages a PCIe wifi
> > device and a bluetooth USB device in the same package. Intel does the
> > same thing on my Wireless 7260.
> >
> > My lsusb shows:
> > Bus 003 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
> > Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> > Bus 001 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
> > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> > Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> > Bus 002 Device 004: ID 8087:07dc Intel Corp. Bluetooth wireless interface
> > Bus 002 Device 003: ID 0bda:c822 Realtek Semiconductor Corp. Bluetooth Radio
> > Bus 002 Device 002: ID 04f2:b3b2 Chicony Electronics Co., Ltd TOSHIBA
> > Web Camera - FHD
> > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> >
> > I have no devices plugged into a USB port.
>
> Okay, now I get the picture. The Intel PCIe card contains an
> EHCI USB host controller plus a couple of on-board USB Bluetooth
> devices and an on-board USB webcam, in addition to the PCIe wifi
> device.
>
> Which means you're looking at the problem all wrong. It isn't a
> USB problem at all; it's a PCI problem. Namely, why doesn't the
> system detect the USB host controller on the PCIe board?
>
> I have added the PCI maintainer and mailing list to the CC.
> Maybe they can help shed some light.
>
> The original Suse Bugzilla report:
>
> https://bugzilla.suse.com/show_bug.cgi?id=1186889
>
> shows the Realtek board at PCI address 0000:03:00.0, but there's
> no mention of a USB host controller on that board. The only host
> controller on the system is the one at address 0000:00:14.0,
> which is xHCI and is directly on the motherboard.
>
> Furthermore, there's no trace of any mention of an EHCI USB host
> controller in the system log. So maybe the board has to be told
> somehow to turn that controller on before it will show up, and
> the rtw_8822ce driver isn't giving the appropriate order.
>
> Can the bug reporter get information from Windows about the USB
> host controllers, and in particular, the one on the RTL8822
> board?
>
> Alan Stern

2021-06-11 02:15:01

by Alan Stern

[permalink] [raw]
Subject: Re: Strange problem with USB device

On Fri, Jun 11, 2021 at 03:08:16AM +0300, Ibrahim Erturk wrote:
> Hi,
>
> I've already attached logs and a snapshot from the device manager on
> the windows side into the bug report. Hope this helps.

Yes, it does help. Although the information in those reports is somewhat
disorganized, it clearly shows there is only one USB host controller in the
system, and that is the one Linux detects. So my impression that we weren't
finding the host controller was wrong.

Back to my earlier guess: The Realtek board has to be told to do something in
order to make the Bluetooth device start working, such as turning on a power
source. (And perhaps that is what the RealTek people were talking about when
they suggested the problem could be in the rtw8822 power-up sequence.) Whatever
it is, the rtw8822 driver isn't doing it.

This means it's still a PCI problem.

Alan Stern

PS: Larry, the discrepancy between Windows reporting an Intel USB hub and Linux
reporting two Linux Foundation hubs isn't real -- or at least, it's what should
be expected. I can explain in more detail if you're curious, but you don't need
to worry about it.