Bug 1634440 - The simultaneous otg+charging mode does not work with 4.18.* kernels
Summary: The simultaneous otg+charging mode does not work with 4.18.* kernels
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-30 19:05 UTC by sergiyvovk69
Modified: 2019-01-31 20:31 UTC (History)
16 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-01-30 23:19:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
OTG hub (35.92 KB, image/jpeg)
2018-09-30 19:05 UTC, sergiyvovk69
no flags Details
kernel 4.16.3 dmesg (49.79 KB, text/plain)
2018-09-30 19:17 UTC, sergiyvovk69
no flags Details
kernel 4.18.9 dmesg (47.72 KB, text/plain)
2018-09-30 19:19 UTC, sergiyvovk69
no flags Details
lsmod output with kernel 4.16.3 (4.08 KB, text/plain)
2018-09-30 19:20 UTC, sergiyvovk69
no flags Details
lsmod output with kernel 4.18.9 (3.70 KB, text/plain)
2018-09-30 19:22 UTC, sergiyvovk69
no flags Details
Errors from journalctl with kernel 4.18.9 (821 bytes, text/plain)
2018-09-30 19:29 UTC, sergiyvovk69
no flags Details

Description sergiyvovk69 2018-09-30 19:05:06 UTC
Created attachment 1488678 [details]
OTG hub

Description of problem:
I have the lynx7 tablet. This tablet has no separate plug for charger. The charger and USB devices can be connected to the one microUSB plug only.

I bought the special mobile otg usb hub for tablet. This hub can be connected to tablet’s microUSB plug. The charger and 
up to 4 USB devices can be connected to this hub.
This hub supports the special mode in which the USB devices and tablet charging work simultaneously.

The simultaneous mode works well with 4.16.3 and 4.17.* kernels.
But with 4.18.* kernels this mode does not work normally. The USB devices on the hub do not work. The charging works.

Version-Release number of selected component (if applicable):
Current 4.18.9 and all 4.18.*.

How reproducible:
Always.

Steps to Reproduce:
1. Install Fedora 28 to lynx7 tablet.
2. Upgrade all packages including kernel.
4. Switch the USB hub to simultaneous otg+charging mode (1). 
3. Check the work of USB devices that are are connected to USB hub.

Actual results:
The USB devices on USB hub do not work. 

Expected results:
The USB devices on USB hub must work. 

Additional info:

Comment 1 sergiyvovk69 2018-09-30 19:14:27 UTC
Admin, I do not see how to fix the description. Please fix it yourself.

Steps to Reproduce:
1. Install Fedora 28 to lynx7 tablet.
2. Upgrade all packages including kernel.
3. Switch the USB hub to simultaneous otg+charging mode (1). 
4. Check the work of USB devices that are are connected to USB hub.

Comment 2 sergiyvovk69 2018-09-30 19:17:13 UTC
Created attachment 1488680 [details]
kernel 4.16.3 dmesg

Comment 3 sergiyvovk69 2018-09-30 19:19:17 UTC
Created attachment 1488681 [details]
kernel 4.18.9 dmesg

Comment 4 sergiyvovk69 2018-09-30 19:20:52 UTC
Created attachment 1488682 [details]
lsmod output with kernel 4.16.3

Comment 5 Hans de Goede 2018-09-30 19:21:40 UTC
Hello,

This bug is not really a bug I'm afraid. Your otg hub has a 1-2-3 switch with the following meanings (I have one myself):

1) Charge (id-pin of the micro-usb floating)
2) ACA mode (70k pulldown on id-pin)
3) Host mode (id-pin shorted to ground)

Except for the ACA mode, there is no such thing as a otg_charging mode in the USB specification and the lynx7 does not have hardware to detect ACA mode, it will treat it the same as either 1 or 3.

Things used to work due to a bug in the Linux kernel where it would not take the initial state of the otg/charge switch on your otg-hub into account.

So if you put it in position 1, then it would happily charge while not touching the mux which switches the data lines between the host controller (needed for the hub to work) and the device-controller (needed for USB gadget mode to work, so that the tablet can e.g. operate as a storage device seen from a PC).

If you take a 4.17 kernel and then throw the switch from 1 to 3 and back to 1 again you will see that you end up with a tablet which is charging but not seeing any devices connected to the hub.

This is the same as what is happening with kernel 4.18, which now actually checks the location of the switch as boot and then switches to device mode, so the hub will not work.

Summarizing earlier kernels had a bug where they would not read the position of the switch on your hub at boot, this accidentally made it possible to use the charge and hub functions at the same time. Now that this bug is fixed this unfortunately no longer is possible.

Regards,

Hans


p.s.

This is caused by this fix which is in 4.18:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ca876c7483b697b498868b1f575997191b077885

Comment 6 sergiyvovk69 2018-09-30 19:22:19 UTC
Created attachment 1488683 [details]
lsmod output with kernel 4.18.9

Comment 7 sergiyvovk69 2018-09-30 19:29:42 UTC
Created attachment 1488684 [details]
Errors from journalctl with kernel 4.18.9

Comment 8 sergiyvovk69 2018-09-30 20:05:25 UTC
Hans, it is very sad that I can not use charge and hub functions at the same time now with kernel 4.18.
I connected the bluetooth adapter, keyboard, mouse to hub. The tablet do not have the strong battery and need charging regularly. If I change the hub mode all USB devices stop to work.
Also often changing hub mode is inconvenient and wear out the switcher.

This tablet also has the Windows 9 and there is no such problem with it.

Are there some workarounds? Where can I get the last 4.17 kernel rpms for Fedora? It was not saved on the tablet. :(
Maybe very first 4.18 kernel will help too.

Comment 9 sergiyvovk69 2018-09-30 20:27:22 UTC
The hub modes:
1 - simultaneous hub + charging.
2 - hub only.
3 - charging only.

Comment 10 Hans de Goede 2018-09-30 20:31:26 UTC
You can find the latest Fedora 4.17 kernel here:
https://koji.fedoraproject.org/koji/buildinfo?buildID=1139102

Installation instructions for kernels from koji are here:
https://fedorapeople.org/~jwrdegoede/kernel-test-instructions.txt

Comment 11 sergiyvovk69 2018-09-30 20:34:58 UTC
Thank you very much.

Comment 12 sergiyvovk69 2018-09-30 22:23:48 UTC
I found the first 4.18.0 kernel here:
https://koji.fedoraproject.org/koji/buildinfo?buildID=1129888
It solved the problem.

Comment 13 Justin M. Forbes 2019-01-29 16:24:45 UTC
*********** MASS BUG UPDATE **************

We apologize for the inconvenience.  There are a large number of bugs to go through and several of them have gone stale.  Due to this, we are doing a mass bug update across all of the Fedora 28 kernel bugs.

Fedora 28 has now been rebased to 4.20.5-100.fc28.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.

If you have moved on to Fedora 29, and are still experiencing this issue, please change the version to Fedora 29.

If you experience different issues, please open a new bug report for those.

Comment 14 sergiyvovk69 2019-01-30 21:47:47 UTC
In 4.20 kernel this bug still exists.
The simultaneous charging and USB devices work is impossible.

I connected the mouse and flash drive to USB otg hub. The check result is following:
Mode 1: the charging only works.
Mode 2: nothing works.
Mode 3: the USB devices only works.

Comment 15 Hans de Goede 2019-01-30 23:19:05 UTC
(In reply to sergiyvovk69 from comment #14)
> In 4.20 kernel this bug still exists.
> The simultaneous charging and USB devices work is impossible.
> 
> I connected the mouse and flash drive to USB otg hub. The check result is
> following:
> Mode 1: the charging only works.
> Mode 2: nothing works.
> Mode 3: the USB devices only works.

As explained in detail in comment 5, this is simply how your hardware works. Micro USB OTG ports typically do not allow both charging and being host at the same type, you need a USB-PD supporting Type-C port for that.

That things used to work before under certain circumstances was due to a bug which has since been fixed. Note that things only worked before when the oth-hub you are using was already inserted at boot, since the firmware left the port in host mode independent of the ID pin of the OTG port, this broke device mode when booting in device mode.

You we're accidentally relying on the broken device mode. Since the broken which has been fixed, as a side effect you can now no longer charge and use the port in host mode at the same time this is according to the OTG spec.

Comment 16 sergiyvovk69 2019-01-31 20:31:21 UTC
Ok. I agree.
BTW now the USB hub is not important because you did a normal bluetooth driver and I can connect the devices through bluetooth.
Thank you!!!


Note You need to log in before you can comment on or make changes to this bug.