From: Oliver Neukum <oneukum@suse.com>
To: "Warren Togami" <wtogami@gmail.com>,
"Oliver Neukum" <oneukum@suse.com>,
"Michael Laß" <bevan@bi-co.net>,
linux-usb@vger.kernel.org
Subject: Re: Cypress CDC ACM serial port not working correctly with autosuspend
Date: Wed, 7 Jun 2023 15:10:15 +0200 [thread overview]
Message-ID: <3d485cd9-e31c-20ac-e595-3000ada983fb@suse.com> (raw)
In-Reply-To: <b748359d-b116-6354-036c-94679bc7b306@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]
On 04.06.23 01:59, Warren Togami wrote:
> On 3/27/23 03:05, Oliver Neukum wrote:
Hi,
>
> https://blockstream.com/jade/
> We have a mass produced device Blockstream Jade with USB serial chip CH9102F 1a86:55d4 misbehaving in the same manner. Tens of thousands of this device were manufactured and sold worldwide. This board fails to communicate with Linux cdc-acm unless autosuspend is turned off (power/control set to 'on'). lsusb -v similarly reports "Bus Powered" and "Remote Wakeup". [1]
OK, then we need to do something about it.
> Either of these workarounds allow this device to work by disabling autosuspend:
>
> * udev rule: ATTRS{idProduct}=="55d4", ATTRS{idVendor}=="1a86", SUBSYSTEM=="usb", TEST=="power/control" ATTR{power/control}="on"
> * usbcore.quirks=1a86:55d4:b
[..]
>
> During the pandemic supply chain constraints led to some switching to the CH9102F which is described here as *almost* a drop-in replacement. Unfortunately the pinout differences might have mattered. I am uncertain if the board design could have been better but that is now in the past. Too many were mass produced so I am hoping for a USB quirk to stabilize this going forward.
>
> I have confirmed USB_QUIRK_RESET_RESUME allows this device to function for the same reason it works for the Cypress. I am uncertain if a narrower new quirk "ignore the remote wakeup bit" would work here. How can I test that?
Please test the attached patch by giving the new 'p' quirk
as usbcore.quirks
Regards
Oliver
[-- Attachment #2: 0001-usb-divorce-RESET_RESUME-from-broken-remote-wakeup.patch --]
[-- Type: text/x-patch, Size: 2073 bytes --]
From 6c6160bb9e315caf2016da20709553ed4f3ca2fd Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@suse.com>
Date: Wed, 7 Jun 2023 15:03:57 +0200
Subject: [PATCH] usb: divorce RESET_RESUME from broken remote wakeup
Some devices falsely advertise supporting remote wakeup.
Such devices fail to work if needs_remote_wakeup needs to be set.
Giving the RESET_RESUME quirk to them, however, can erase
state in case the device alternates between operating modes
in which needs_remote_wakeup is set and not set.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
drivers/usb/core/driver.c | 3 +++
drivers/usb/core/quirks.c | 3 +++
include/linux/usb/quirks.h | 3 +++
3 files changed, 9 insertions(+)
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 039ae981503b..ceff0bb752e5 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1913,6 +1913,9 @@ static int autosuspend_check(struct usb_device *udev)
intf->needs_remote_wakeup)
return -EOPNOTSUPP;
}
+ if (udev->quirks & USB_QUIRK_REMOTE_BROKEN)
+ if (intf->needs_remote_wakeup)
+ return -EOPNOTSUPP;
}
}
if (w && !device_can_wakeup(&udev->dev)) {
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 934b3d997702..ff49c55c513d 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -138,6 +138,9 @@ static int quirks_param_set(const char *value, const struct kernel_param *kp)
case 'o':
flags |= USB_QUIRK_HUB_SLOW_RESET;
break;
+ case 'p':
+ flags |= USB_QUIRK_REMOTE_BROKEN;
+ break;
/* Ignore unrecognized flag characters */
}
}
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index eeb7c2157c72..7c81ad49f1a0 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -72,4 +72,7 @@
/* device has endpoints that should be ignored */
#define USB_QUIRK_ENDPOINT_IGNORE BIT(15)
+/* device falsely claims to support remote wakeup */
+#define USB_QUIRK_REMOTE_BROKEN BIT(16)
+
#endif /* __LINUX_USB_QUIRKS_H */
--
2.40.1
next prev parent reply other threads:[~2023-06-07 13:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-29 11:44 Cypress CDC ACM serial port not working correctly with autosuspend Michael Laß
2023-01-30 13:03 ` Oliver Neukum
2023-01-30 13:08 ` Oliver Neukum
2023-01-30 15:44 ` Michael Laß
2023-02-07 19:35 ` Michael Laß
2023-03-14 13:16 ` Oliver Neukum
2023-03-18 12:09 ` Michael Laß
2023-03-23 9:51 ` Oliver Neukum
2023-03-23 12:52 ` Michael Laß
2023-03-23 13:53 ` Oliver Neukum
2023-03-23 21:32 ` Michael Laß
2023-03-27 8:05 ` Oliver Neukum
2023-06-03 23:59 ` Warren Togami
2023-06-07 13:10 ` Oliver Neukum [this message]
2023-06-08 0:48 ` Warren Togami
2023-06-13 8:36 ` Oliver Neukum
2023-06-12 18:39 ` Michael Laß
2023-06-07 14:33 ` Michael Laß
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d485cd9-e31c-20ac-e595-3000ada983fb@suse.com \
--to=oneukum@suse.com \
--cc=bevan@bi-co.net \
--cc=linux-usb@vger.kernel.org \
--cc=wtogami@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.